Getting the dimensions of a remote image file without having to save it to the hard drive
- by kaloyan
I am looking for a way to get the dimensions of a remote image file without having to save it to the hard drive -- I am trying to skimp on the I/O requests. Basically something like PHP's getimagesize() function.
I did try something like this:
print Image.open(urllib2.urlopen(src)).size
but PIL wants a file handle that has a seek() method.
Any ideas?