Read dimensions from a JPEG, GIF, PNG or TIFF file and return an array
with width and height, or if the file isn't a valid image,
0
. The argument file should be file object or the data
from a file. The offset pointer will be assumed to be at the start
of the file data and will be modified by the function.
As a compatibility measure, if the file is a path to an image
file, it will be loaded and processed once the processing of the
path as data has failed.