Any Python modules for manipulating JFIF file contents?
jepler at unpythonic.net
Tue Jun 1 22:44:59 EDT 2004
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
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!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 196 bytes
Desc: not available
More information about the Python-list