Re: Any Python modules for manipulating JFIF file contents?

From: Jeff Epler (jepler_at_unpythonic.net)
Date: 06/02/04


Date: Tue, 1 Jun 2004 21:44:59 -0500
To: Kenneth McDonald <kenneth.m.mcdonald@sbcglobal.net>


PIL can extract information like resolution.

exifdump.py and EXIF.py can read the "EXIF" data that accompanies many
photos taken on digital cameras. This can include a thumbnail,
information like exposure time and focal length, and on some cameras it
even tells you the orientation of the camera when the picture was taken.
These two programs don't have any external requirements, they parse the
JFIF and EXIF structures in pure Python.

There are also Python wrappers for imlib and imagemagick, two other
(unix) libraries often seen for image manipulation. I used imlib long
ago, but I've never used imagemagick.

My online photo albums (http://photos.unpy.net) use python with image
metadata stored in a postgres database and the images themselves stored
on the filesystem. It uses exifdump.py to read EXIF information. The
source code to this is too nasty for me to consider sharing it with the
world.

More recently, I've been writing an image viewer in pygame, with the
primary goal to reduce how often the user waits for a response. For
instance, when the program is idle it preloads and scales the
next/previous image in the image sequence. This has been fun (and I'm
glad I learned pygame) but a user madly pressing "next" on an 800MHz
machine can always get ahead of the computer trying to load 6 megapixel
photos! To make things worse, PIL doesn't seem to release the GIL
during long operations (such as loading a JPEG image or scaling it, each
of which can take 2 seconds), and lacks progress callbacks (let alone a
way to abort one of these operations in progress)...

Have fun with your project!

Jeff






Relevant Pages

  • Re: OT: Best Inexpensive Point n Shoot
    ... hobbiest high-res cameras store the images as _compressed_ files. ... without significant _apparent_ loss of quality. ... specified within the Exif sub-IFD, ... We subsequently add location info to the Exif data of photos taken with our ...
    (rec.outdoors.rv-travel)
  • Re: Original file datestamp in uploads
    ... ask for the date in a separate field ... most digital cameras place on the photos they take. ... in php this is acomplished using the exif extension, ...
    (comp.lang.php)
  • Exif date and time change
    ... I use Lightroom to import and manage photos. ... That way I can synchronize photos between many cameras. ... synchronized the cameras before the event, I have to change the exif date ...
    (rec.photo.digital.slr-systems)
  • Re: Who Are You??
    ... I've been playing since 1964, and I play mostly with my ... Like Norm, however, I eschew ... photos that would have otherwise been lost memories. ... Bettie knew I was checking all cameras, lenses, and stuff before we ...
    (rec.music.makers.guitar.acoustic)
  • Re: Speed cameras flawed
    ... >> checking the accuracy of the photos taken by the Gatso cameras in the ... See above - the prosecuting authority is obliged by law to present to ... the accused the evidence being used to prosecute him/her - no excuses, ...
    (uk.transport)