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
https://forums.phpfreaks.com/topic/284288-new-gd-image-syntax-for-convert/
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.

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.