Home > HowTo > Fix Gallery3 to extract IPTC headlines and captions

Fix Gallery3 to extract IPTC headlines and captions

Gallery3, a web based photo album organizer, can extract the IPTC.Caption field of photos you import. This caption is then used to set the description of photos. However, this default behavior might not be what you would expect.

Introduction to Gallery and IPTC

Gallery is an open source web based photo album organizer. Gallery3 intends to replace the famous Gallery2. At the day of this writing, Gallery 3.0.2 is the latest release. Please find more information on the website.

The IPTC IIM is a standard defining a set of metadata directly saved in photo files and thus allowing the portability of photo information and the compatibility between photo software. More information on IPTC can be found in the resources.

Change Gallery’s default behavior

The current stable release (Gallery 3.0.2) only extracts the IPTC.Caption field of photos you import. However, the world is imperfect and photo software are not using the same IPTC fields to designate the title and the description of a photo. As far as I know, metadata fields should match:

IPTC.Headline or IPTC.ObjectName => Title
IPTC.Caption or IPTC.Comment => Description

As I share my Gallery3 space with other users (who are potentially using different software) and that we usually set only a title to pictures, I’d like Gallery to automatically find and set the photos titles. In other words:

if IPTC.Headline or IPTC.ObjectName is set
   photo.title = (IPTC.Headline or IPTC.ObjectName)
   if IPTC.Caption or IPTC.Comment is set
     photo.description = (IPTC.Caption or IPTC.Comment)
else if IPTC.Caption or IPTC.Comment is set
   photo.title = (IPTC.Caption or IPTC.Comment)

You’ll find my patch here. Enjoy it! I did not send this code to the official project because developers don’t seem to agree on IPTC tags use (see the tickets in resources).

Resources

Advertisement
Categories: HowTo Tags: , ,
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.