Page 1 of 1

Convert of big (60MB) JPG file - performance problem

Posted: 2010-02-11T08:00:53-07:00
by basstradamus
I have timing issue. When I try to conver quite big jpg file 60-100 MB to small gif it takes around 50 sec. Morover when the same command is runned from PHP the it takes around 5 minutes! Morover CPU usage is 100% which completelly kills web server.
My question is is there any way to do this faster? Actually I generate preview so it doesn't have to be in very good quality. But it need to be generated fast 3-4 sec.

Here is the command which I use

time convert "Test.jpg" -units PixelsPerInch -density 72 -quality 60 -resize 200 "output.gif"

real 0m48.356s
user 0m32.182s
sys 0m11.110s

Re: Convert of big (60MB) JPG file - performance problem

Posted: 2010-02-11T08:32:24-07:00
by Bonzo
Try adding a jpg hint before reading the image:

Code: Select all

convert -size 200x200 "Test.jpg" -units PixelsPerInch -density 72 -quality 60 -resize 200 "output.gif"
Depending how new your IM version is there is a new method of writing this but I can not remember what it is !

Re: Convert of big (60MB) JPG file - performance problem

Posted: 2010-02-11T09:51:24-07:00
by fmw42
newer method is

-define jpeg:size=200x200 which replaces -size 200x200 as the jpeg hint

see http://www.imagemagick.org/Usage/formats/#jpg_read