imagefacts 1.1

Find out the screen dimensions of the commonest image formats from a URL or bytestring

  Add it to your Download Basket!

 Add it to your Watch List!

0/5

Rate it!
send us
an update
LICENSE TYPE:
BSD License 
USER RATING:
UNRATED
  0.0/5
DEVELOPED BY:
Mark Paschal
HOMEPAGE:
github.com
CATEGORY:
ROOT \ Multimedia \ Graphics
imagefacts is a Python module that 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.fact() 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)

Last updated on November 18th, 2011

requirements

#screen dimensions #Python library #Python #bytestring #screen #dimensions

Add your review!

SUBMIT