[Tutor] trying to get data from digital camera.jpg file
kent_johnson at skillsoft.com
Wed Aug 11 16:33:40 CEST 2004
Try opening the file in binary mode, that is what exiftool does:
file = open('temp.jpg', 'rb')
At 09:18 AM 8/11/2004 -0400, John Matthews wrote:
>I read this list each day and find it quite informative and enjoyable.
>I am a beginning programmer and I am trying to use EXIF to get the "Image
>DateTime" from my .jpg files for a little program I am writing that makes
>web pages for my family photos.
>I am trying to use EXIF.py by Gene Cash. He also has written exiftool.py,
>and both of these files are available here:
>Just messing around at the interpreter I do something like this and get
>what appears to be an empty dictionary.
>import EXIF, os
>file = open('temp.jpg')
>data = EXIF.process_file(file)
>I thought that would dump the same data I get at the command prompt when I do:
>exiftool.py -v temp.jpg
>but I must be way off. If someone can offer me a pointer I would really
>McDonald, Cassell & Bassett, Inc.
>600 West Spring Street
>Columbus, Ohio 43215
>(614) 628-0633 Fax
>Tutor maillist - Tutor at python.org
More information about the Tutor