coppermine-gallery.com/forum

Support => Older/other versions => cpg1.3.x Support => Topic started by: gsownsby on October 11, 2004, 06:59:00 PM

Title: ImageMagick - Edit Images / Not Rotating
Post by: gsownsby on October 11, 2004, 06:59:00 PM
I have Coppermine 1.3.2 up and running on my home web server.  I also installed ImageMagick and correctly specified the path in the setup/config for Coppermine.  When logged in as Admin, I can pull up an image and click "Crop and Rotate" but the rotation does not occur.  The image 'blinks" out for a second then appears just the same...no changes.  Any thoughts on what may be wrong?  Thanks.

All other Coppermine functions appear to be working.  I've double-checked the path to ImageMagic which is c:/imagemagick


Other Configuration Info:  Windows XP Professional; Abyss Web Server; MYSQL; ImageMagick
Title: Re: ImageMagick - Edit Images / Not Rotating
Post by: kegobeer on October 11, 2004, 07:23:54 PM
Open up include/imageObjectIM.class.php.

Find
$cmd = "{$CONFIG['impath']}convert -quality {$this->quality} {$CONFIG['im_options']} -crop '{$new_w}x{$new_h} +{$clip_left} +{$clip_top}' $imgFile $imgFile";

Replace with:
$cmd = "{$CONFIG['impath']}convert -quality {$this->quality} {$CONFIG['im_options']} -crop {$new_w}x{$new_h}+{$clip_left}+{$clip_top} $imgFile $imgFile";

Find
$cmd = "{$CONFIG['impath']}convert -quality {$this->quality} {$CONFIG['im_options']} -rotate '$angle' $imgFile $imgFile";

Replace with
$cmd = "{$CONFIG['impath']}convert -quality {$this->quality} {$CONFIG['im_options']} -rotate $angle $imgFile $imgFile";

Also look in your php.ini file for variables_order or gpc_order (depending on your php version, gpc_order is depreciated).  The common order is "GPC" or "GPCS".  In order for $_ENV to work it needs to be "GPCE" or "GPCES".  If you don't want to mess with your php.ini file, make these changes in imageObjectIM.class.php:

Find all instances of

eregi("win",$_ENV['OS']

and replace with

eregi("win",getenv('OS'))
Title: Re: ImageMagick - Edit Images / Not Rotating
Post by: gsownsby on October 12, 2004, 08:07:18 PM
Kegobeer,

Thank you for your reply.  Your solution worked.  As I read it, basically it was to remove a single quote mark in a few places and add the GETENV statements.

Just out of curiosity, is this "fix" documented somewhere and I missed it?  Thanks again.

gsownsby
Title: Re: ImageMagick - Edit Images / Not Rotating
Post by: kegobeer on October 13, 2004, 12:56:44 AM
No, I fixed this in the devel version, but forgot to apply the fix to the current stable version.
Title: Re: ImageMagick - Edit Images / Not Rotating
Post by: Alejandrito on October 14, 2004, 01:19:19 PM
greit!!

now works for me too :D thanks very much