Read Exif via Python Friday, January 14, 2011

Installtion

  1. download library
  2. extract it
  3. copy exif.py to Lib folder
  4. Some API demo source code can been found in comments sectio in exif.py

Demo

import EXIF
# extract thumbnail in Exif and save it
f = open("c:\\p2.jpg",'rb')
tags = EXIF.process_file(f)
# save the thumbnail into a jpg format file
f = open("c:\\a.jpg",'wb')
f.write(tags["JPEGThumbnail"])
f.close()

0 comments: