Python lib to read width and height of image files
Project description
dimensions
==========
A pure Python library for reading the width and height of images.
installation
------------
`pip install dimensions`
Done.
usage
-----
For a single image:
> dimensions src/sample.png
src/sample.png
width: 405
height: 239
content_type: image/png
Wildcards also work (escape \* in markdown for PyPi RST...):
> dimensions src/\*.png
src/sample.png
width: 405
height: 239
content_type: image/png
src/sample2.png
width: 473
height: 469
content_type: image/png
As always, full details are available via `dimensions -h`.
In Python code, simply call `dimensions.dimensions`. If you provide a
sequence of filenames, you get back a sequence of tuples; if you provide
just a single filename, you get back a single tuple.
import dimensions
dims = dimensions.dimensions('./src/sample.png')
# (405, 239, 'image/png', './src/sample.png')
future
------
- release newer version to PyPi
==========
A pure Python library for reading the width and height of images.
installation
------------
`pip install dimensions`
Done.
usage
-----
For a single image:
> dimensions src/sample.png
src/sample.png
width: 405
height: 239
content_type: image/png
Wildcards also work (escape \* in markdown for PyPi RST...):
> dimensions src/\*.png
src/sample.png
width: 405
height: 239
content_type: image/png
src/sample2.png
width: 473
height: 469
content_type: image/png
As always, full details are available via `dimensions -h`.
In Python code, simply call `dimensions.dimensions`. If you provide a
sequence of filenames, you get back a sequence of tuples; if you provide
just a single filename, you get back a single tuple.
import dimensions
dims = dimensions.dimensions('./src/sample.png')
# (405, 239, 'image/png', './src/sample.png')
future
------
- release newer version to PyPi
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
dimensions-0.0.2.tar.gz
(3.5 kB
view details)
File details
Details for the file dimensions-0.0.2.tar.gz
.
File metadata
- Download URL: dimensions-0.0.2.tar.gz
- Upload date:
- Size: 3.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 06b7ff50f9dd055531a25a6bf291829176d56af5ff3f8a9ab9d5788e30044df7 |
|
MD5 | 4848356907452a932e06d21837512df2 |
|
BLAKE2b-256 | 8e0305ba33cce90ef375f4f2aa17cf86cfe27a09665dba3947dd94a457084626 |