Jump to content

New GD image syntax for "convert"


Tomislav

Recommended Posts

Anyone knows how to change the code posted above to work on server wit PHP 5.3. ?

 

 

elseif (isset($_POST['todoaction']) && $_POST['todoaction'] == 'save') 

{

$original = 'o_'.$_POST['slika'];

 

$path = getenv('DOCUMENT_ROOT').'/images/content/';

 

$v = exec("convert ".$path.$original." -crop ".$_POST['width']."x".$_POST['height']."+".$_POST['x1']."+".$_POST['y1']." ".$path.$_POST['slika']);

 

list($width, $height) = getimagesize($path.$_POST['slika']);

 

if (isset($_POST['h']) && $_POST['h'] != '')

{

$v = @exec("convert ".$path.$_POST['slika']." -resize ".$_POST['w']."x".$_POST['h']." ".$path.$_POST['slika']);

}

else

{

$v = @exec("convert ".$path.$_POST['slika']." -resize ".$_POST['w']."x225 ".$path.$_POST['slika']);

}

unset ($slika);

}

 

Link to comment
Share on other sites

This is not PHP GD or a PHP version problem.

 

The code you posted is using exec to run a an ImageMagick command to convert the images.

 

For this code to work you need to have ImageMagick installed on the server. If you cant do this then you need to recode it to use the PHP GD image library instead.

It is not working, so i assume that ImageMagick is not installed on server.

And that is the reason i have asked for some help here, because I',m not a programmer but I would like to solve that problem myself.

So, can someone help me recode it to use PHP GD image functions.

 

Thanks.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.