Details
-
Improvement
-
Status: Closed
-
Normal
-
Resolution: Fixed
-
gallery-magick-3.0.1
-
None
-
None
Description
According to GraphicsMagick documentation [1],
To make a thumbnail of a JPEG image, use: gm convert -size 120x120 cockatoo.jpg -resize 120x120 +profile "*" thumbnail.jpg In this example, '-size 120x120' gives a hint to the JPEG decoder that the image is going to be downscaled to 120x120, allowing it to run faster by avoiding returning full-resolution images to GraphicsMagick for the subsequent resizing operation. The '-resize 120x120' specifies the desired dimensions of the output image. It will be scaled so its largest dimension is 120 pixels. The '+profile "*"' removes any ICM, EXIF, IPTC, or other profiles that might be present in the input and aren't needed in the thumbnail.
So, if "-size WxH" is provided, the decoder may run faster. When experimenting it with an example image file, it makes a big difference as well. e.g, 0.2s vs 1.2s.
Also, when resizing an image to create a variant, it makes sense to remove the ICM, EXIF, IPTC metadata from the image as those metadata still exists in the original image file anyway. We don't need to provide all the metadata such as digital camera info or geo coordinates, etc. on the thumbnail images, for instance.