Skip to main content

Find the size or type of the image without fetching the whole content.

Project description

imgspy finds the metadata (type, size) of an image given its url by fetching as little as needed. This is a python implementation of fastimage. Supports image types BMP, CUR, GIF, ICO, JPEG, PNG, PSD, TIFF, WEBP.


{'type': 'png', 'width': 1920, 'height': 1080}
>>> with requests.get('', stream=True) as res:
{'type': 'png', 'width': 1920, 'height': 1080}
{'type': 'jpg', 'width': 420, 'height': 240}
>>> with open('/path/to/image.jpg') as f:
{'type': 'jpg', 'width': 420, 'height': 240}

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for imgspy, version 0.2.2
Filename, size File type Python version Upload date Hashes
Filename, size imgspy-0.2.2-py3-none-any.whl (3.4 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size imgspy-0.2.2.tar.gz (3.0 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page