I\'m looking for a fast way to get the height and width of an image in pixels. It should handle at least JPG, PNG and TIFF, but the more the better. I emphasize
Imagemagick -ping
option
It seems to have been introduced for that purpose.
However as of ImageMagick 6.7.7 I don't observe slowdown even for every large files, e.g.:
head -c 100000000 /dev/urandom > f.gray
# I don't recommend that you run this command as it eats a lot of memory.
convert -depth 8 -size 20000x10000 f.gray f.png
identify f.png
Can you produce an example input image for which it is still slow?
See also: Can ImageMagick return the image size?