Imagemagick is working, but commands are not Imagemagick is working, but commands are not
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

Imagemagick is working, but commands are not

Started by sunshinebrian, February 22, 2006, 06:02:20 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

sunshinebrian

Hi guys, I've googled everywhere for an answer to this but cannot find anything so if somebody could help me out here, I'd be ever so appreciative!  :)

So, I installed Coppermine and found my Imagemagick path. I tried out the commands -flip and -flop to see if the magick was indeed working correctly and sure enough, when I batch added files they were upside down and mirrored.

Now, what I want to do though is for Image Magick to automatically crop all the thumbnails so they're the same dimensions (70x100) without losing aspect ratio. I thought the crop command would do it so I tried combinations of:
-crop 70x100
-crop 70x100+0+0
-gravity center -crop 70x100+0+0


However, this yielded the following error when uploading the images:
Error executing ImageMagick - Return value: 1

Could somebody help me out on how to change the command so it will work? Or if coppermine even supports cropping thumbails?

Stramm

don't use the ImageMagick options box in config... this will affect all images (thumbs, normal and fullsize if you autoresize them). Maybe useful to sharpoen images but this has downsides as well.

To crop thumbs you need to calculate a lot of stuff (and it's dependig on width/hight) --> in the end you have a formula like (example)
-crop ".$thb_width."x".$thb_height."+0+".round(($resized_h - $thb_height)/2 (for $srcWidth/$srcHeight < $thb_width/$thb_height)
still that's not the end of things. You need to implement that into the upload, batch add process then you need to add new calculations for the img tag. Cause coppermine doesn't support this out of the box you need to add new code at various places.

For more info have a look at the mods board. CHeck my modpack threads. They deal with this too and especially for thumb cropping /sharpening read the better thumbs thread