Re: PIL and IPTC
- From: Scott SA <pydev@xxxxxxxxxxxx>
- Date: Wed, 30 Apr 2008 11:09:23 -0600
On 4/30/08, Jumping Arne (arnlen@xxxxxxx) wrote:
I'm completely new to PIL and I'm trying to read IPTC info, I understand that
it's possible but I can't find out how (and for once Google doesn't seem to
be able to help). Does anyone have an example of how it's done?
Some basic PIL info:
<http://www.pythonware.com/library/pil/handbook/index.htm>
<http://effbot.org/imagingbook/> has a tutorial and more info
It has been a while since I had to do it but effectively, you need to open the image before you can extract the IPTC as I recall.
This should give you a starting point:
from PIL import IptcImagePlugin
dir(IptcImagePlugin)
then...
help(IptcImagePlugin.getiptcinfo)
A Google Search for 'how-to' gives some insight
<http://www.google.ca/search?q=how-to+read+iptc+python-imaging-library>
The process is similar to reading EXIF info, I suggest you look there and modify as necessary. So a modified search to include EXIF
<http://www.google.ca/search?q=how-to+read+iptc+%7C+exif+python-imaging-library>
While not PIL exclusive, the following should be useful:
<http://www.velocityreviews.com/forums/t592465-ann-phatch-photo-batch-processor-and-renamer-based-on-pil.html>
There are also separate libraries for IPTC with Python bindings. One is called libiptcdata. It lives here:
<http://libiptcdata.sourceforge.net/>
Another example using IPTCInfo:
<http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/500266>
And another python-based (non PIL) one here:
<http://www.jfroche.be/open-source/python-iptc-parser/iptc.py/view>
While not a direct answer, I hope this is helpful,
Scott
.
- Prev by Date: Re: computing with characters
- Next by Date: Re: I messed up my wxPython install (Eclipse Configuration Issue)
- Previous by thread: Re: PIL and IPTC
- Next by thread: Re: List all files using FTP
- Index(es):