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.
usage
>>> imgspy.info('http://via.placeholder.com/1920x1080')
{'type': 'png', 'width': 1920, 'height': 1080}
>>> with requests.get('http://via.placeholder.com/1920x1080', stream=True) as res:
... imgspy.info(res.raw)
{'type': 'png', 'width': 1920, 'height': 1080}
>>> imgspy.info('/path/to/image.jpg')
{'type': 'jpg', 'width': 420, 'height': 240}
>>> with open('/path/to/image.jpg') as f:
... imgspy.info(f)
{'type': 'jpg', 'width': 420, 'height': 240}
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
imgspy-0.2.2.tar.gz
(3.0 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file imgspy-0.2.2.tar.gz.
File metadata
- Download URL: imgspy-0.2.2.tar.gz
- Upload date:
- Size: 3.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.28.1 CPython/3.7.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
752486957a9e7160f39a86ff7cf38f0e206aa17cd30f91f93495d6d5eeb8f4dc
|
|
| MD5 |
56846db034c630354890b275d9bb728f
|
|
| BLAKE2b-256 |
bedfed46fab7a0005abb8d367a861189e8b1735ffa773bc9f5b7c413e1024552
|
File details
Details for the file imgspy-0.2.2-py3-none-any.whl.
File metadata
- Download URL: imgspy-0.2.2-py3-none-any.whl
- Upload date:
- Size: 3.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.28.1 CPython/3.7.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dfcdcef89521efc01f2e4e1007d19ef9ad83f88541a3794fcae29c1b12c7f6a9
|
|
| MD5 |
d3e29b3d37d31471d2a10e66814397d1
|
|
| BLAKE2b-256 |
8cb0ba26341f28b4056d525fc6ec569f539c2ab8020061bc54855a2e4fd67cb8
|