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
You can use ImageMagick's identify function. Here's how you do it in bash (Note $0 is the image's path):
width=$(identify -format "%w" "$0")> /dev/null
height=$(identify -format "%h" "$0")> /dev/null
And this also hides any potential error messages. Modern implementations of identify only read the header, not the whole image, so it is fast. Not sure how it compares to other methods though.