In trying to simply thumbnail an image in PHP I used:
$image = new Gmagick('/tmp/large.jpg');
$image->thumbnailImage(0, 100);
$image->writeImage('/tmp/small.jpg');
which ran in about 15 seconds.
I then tried:
exec('gm convert -size 200x100 /tmp/large.jpg -resize 200x100 +profile "*" /tmp/small.jpg');
which ran in less than one second.
Can someone explain why, in as much detail as possible? Also, are there any reasons I "shouldn't" use the second method? Or is there a way to make the gmagick extension faster?
Version details:
gmagick - 1.1.0RC3
GraphicsMagick - GraphicsMagick 1.3.17 2012-10-13 Q8