imagefacts
imagefacts discovers the screen dimensions of the commonest image formats from a URL or a bytestring.
Installation
Install the latest imagefacts from PyPI:
$ pip install imagefacts # or $ easy_install imagefacts
Usage
Use the imagefacts.facts() function to find an image’s dimensions:
>>> import imagefacts
>>> imagefacts.facts(open('localfile.jpg').read()) # byte string
('image/jpeg', 1024, 768)
>>> imagefacts.facts(open('localfile.jpg')) # file object
('image/jpeg', 1024, 768)
>>> imagefacts.facts('localfile.jpg') # file name
('image/jpeg', 1024, 768)
>>> imagefacts.facts('http://example.com/image') # URL
('image/png', 400, 476)
>>>
You can also use imagefacts from the command line:
$ python -m imagefacts http://example.com/image
('image/png', 400, 476)
$
Contributors
Portions of imagefacts are from the feedparser project by Mark Pilgrim and bfg-pages by zutesmog. Thanks!
Metadata
Release files for imagefacts 1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| imagefacts-1.1.tar.gz | 4.9 kB | Without provenance | Details for imagefacts-1.1.tar.gz |
Release files / imagefacts-1.1.tar.gz
| Download URL | imagefacts-1.1.tar.gz |
|---|---|
| Size | 4.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bfc626e1056e6247f24320263ac22b78f54c087dc4bffd8a769d73d6cae73d44
|
|
BLAKE2b-256 checksum How to use checksums |
16f2b1bf3a2ab475a3c08d4ecb8a02c47fc7083f27cb3f4b9cca113665229740
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for imagefacts 1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.