<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DZone Snippets: iptc code</title>
    <link>http://snippets.dzone.com/posts</link>
    <pubDate>Sun, 27 Jul 2008 08:25:33 GMT</pubDate>
    <description>DZone Snippets: iptc code</description>
    <item>
      <title>Reading and writing image metadata</title>
      <link>http://snippets.dzone.com/posts/show/768</link>
      <description>The IPTCInfo module allows you to add/edit metadata &lt;br /&gt;to your image. You can download it from &lt;a href=http://cheeseshop.python.org/pypi/IPTCInfo/&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Reading&lt;br /&gt;&lt;code&gt;&lt;br /&gt;from iptcinfo import IPTCInfo&lt;br /&gt;info = IPTCInfo('test.jpg')&lt;br /&gt;print info.keywords, info.supplementalCategories, info.contacts&lt;br /&gt;caption = info.data['caption/abstract']&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;Add/Edit&lt;br /&gt;&lt;code&gt;&lt;br /&gt;info = IPTCInfo('test.jpg')&lt;br /&gt;info.data['caption/abstract'] = 'Witty caption here'&lt;br /&gt;info.data['supplemental category'] = ['portrait']&lt;br /&gt;info.save()&lt;br /&gt;info.saveAs('test_out.jpg')  # keep original safe&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;</description>
      <pubDate>Thu, 29 Sep 2005 22:09:49 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/768</guid>
      <author>korakot (Korakot Chaovavanich)</author>
    </item>
  </channel>
</rss>
