[Image-SIG] Preserving EXIF data and image.info['dpi'] missing

Ryan Neve neve at email.unc.edu
Wed Feb 20 21:11:01 CET 2013

I'm using PIL with a time lapse camera to add some text and a few 
reference lines to an image. I'm using jpeg, but may switch to ppm 
(converted from raw). I have two problems.

First, it seems as if PIL can read EXIF data but not write it. Is this 
correct? I've seen a lot of posts asking this question, but no recent 
answers. I really need the EXIF data preserved when I save the image.

Second, when saving, the default dpi is 72, not the original dpi. I saw 
someone suggest:

image.save('file.jpeg', dpi = image.info['dpi'])

but my image.info is {'exif':'very long string...'} with no dpi key.

I ended up hard coding my (300,300) dpi, but this seems less than ideal.


*Ryan Neve*
University of North Carolina
Institute of Marine Sciences
3431 Arendell St
Morehead City, NC 28557
(252) 726-6841 x179
(252) 726.2426 Fax

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/image-sig/attachments/20130220/7c0ff5a1/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: neve.vcf
Type: text/x-vcard
Size: 300 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/image-sig/attachments/20130220/7c0ff5a1/attachment.vcf>

More information about the Image-SIG mailing list