[RESOLVED] Convert locking up with specific image.

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
mmazing
Posts: 3
Joined: 2011-11-22T14:29:30-07:00
Authentication code: 8675308

[RESOLVED] Convert locking up with specific image.

Post by mmazing »

Hello,

I manage a website where people can upload photos for various reasons, and came across a particular file that was causing convert to lock up and create enormous temporary files.

The command was :

/usr/local/bin/convert FILENAME.JPG -resample 72x72 -resize 0.66% /data/www/temp_photos/FILENAME_2.JPG

The image was :

http://removed.jpg

The debug output was :

http://dl.dropbox.com/u/10460707/convert-debug2.txt

The debug would have continued on for quite a while, it looks like it is processing each individual pixel when I just let the debug output go for a while.

Using identify on the original image (this command) :

identify -format "%[colorspace] %[xresolution] %[width] %[height]" FILENAME.JPG

Yields - RGB 2 3937 2625

Thanks for any help! This one has me stumped.
- Chase
Last edited by mmazing on 2011-11-22T15:46:04-07:00, edited 1 time in total.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Convert locking up with specific image.

Post by fmw42 »

your input image density (resolution) = 2, so perhaps -resample is having trouble or making a huge image before you resize by 0.66% which is very small.

Why don't you just resize the input image to your desired WxH and then set the density to 72.

convert yourimage.jpg -resize WxH -density 72 resultimage.jpg
mmazing
Posts: 3
Joined: 2011-11-22T14:29:30-07:00
Authentication code: 8675308

Re: Convert locking up with specific image.

Post by mmazing »

It seems to be a problem with the resampling, for some reason the original image has a DPI of "2/1" in the EXIF data.

The problem goes away if I remove the -resample 72x72 option.
mmazing
Posts: 3
Joined: 2011-11-22T14:29:30-07:00
Authentication code: 8675308

Re: Convert locking up with specific image.

Post by mmazing »

fmw42 wrote:your input image density (resolution) = 2, so perhaps -resample is having trouble or making a huge image before you resize by 0.66% which is very small.

Why don't you just resize the input image to your desired WxH and then set the density to 72.

convert yourimage.jpg -resize WxH -density 72 resultimage.jpg
Thanks, I'll try this.

Edit : I'm pretty sure this will fix it, thanks again.
Post Reply