Forum Moderators: phranque

Message Too Old, No Replies

Imagemagick: Resizing and Converting Issues

         

Medianeer

10:44 pm on Sep 8, 2006 (gmt 0)

10+ Year Member



Hello there,
Here's what I'm trying to do with imagemagick:

1. Resize a jpg/gif image of random dimensions to fit a space of 80x60 while keeping it's aspect ratio (no stretching or cropping)

2. Fill any empty space with white to maintain the 80x60 size

So, if I feed the program a 100x100 image file, I want to get the image resized to 60x60 inside a white 80x60 box. Sort of like the thumbnails you see on ebay. The extra space is filled with white.

I was using this 2 lines of code to acomplish this, and it worked, but for some reason it doesn't work on the server I'm using now:

convert -verbose -size 80x60 -resize 80x60 -density 72x72 -dither -flatten +profile "*" old.jpg new.jpg

composite -verbose -geometry 80x60 -gravity center new.jpg -size 80x60 -resize 80x60 xc: white new.jpg

Any ideas on how do I accomplish this?

Thanks for any help in advance!

gbulmash

9:36 pm on Sep 28, 2006 (gmt 0)

10+ Year Member



I'm no ImageMagick expert, so I can't troubleshoot your code snippet, but it seems that if the code snippet hasn't changed, then something in ImageMagick has, and that's your first place to look.

Have you compared the version of ImageMagick you were using on the old server with the version on the new server?

If the new server has an older version, the solution would be to simply upgrade ImageMagick. If it has a newer version, you might want to consider downgrading or looking at the docs of the newer version to see if the functions you're using have changed their syntax.

Cheers,

Greg