IPTC JPEG Tagger

What is IPTC

The IPTC (International Press Telecommunications Council) is a consortium of the world's major news agencies and news industry vendors. It develops and maintains technical standards for improved news exchange that are used by virtually every major news organization in the world. See here for the Wiki Definition. The Metadata Working Group (MWG), a consortium of companies including Adobe, Apple, Canon, Microsoft, Nokia and Sony are working to bring together the disparate ways of marking up images, IPTC plays a major part in the standard, see here.

Their JPEG image meta data standard defines an application segment (APP13 segment) appended after the image data which can hold data in a pre-defined set of tags.

settags.pl

The settags utility allows the user to set the IPTC meta data tags on any JPEG image by providing the IPTC values as command line strings. The files these are applied to are controlled by the standard file specification filter, and as such tags can be set on one, tens or hundreds of files simultaneously. The program supports Add, Replace or Update modes so mistakes can easily be rectified, specific tags can be added, appended to or replaced, and changes can be made en-mass to an entire directory or file system.

Only the APP13 segment is modified, this means the image data is not modified in any way so it is will not change the image or resolution of the image. The utility can also read any of the standard as well as user defined tags in an image and provide a list of these.

This software is free and you may do anything like with it except sell it. If you modify it for the better please let me know so I can update my version too.

Using settags

The objective of settags is to make IPTC metadata tags easily managable, you can view, add, delete and replace (all functionality provided from the library). The script fronts the file selection and processing to simplify mass updates so keywords may be added to lots of files in one go.

Supported IPTC tags

Below are the IPTC tags which the program supports along with the flags the program expects to set these values

Single value tags

Multiple value tags (comma separated)

An extract of the usage instructions follows
    This program supports processing of metadata (IPTC/EXIF) in JPEG (and other)
    files, many files may have many keywords, categories and comments added,
    replaced or updated at the same time.

    usage: $0 -[U|R|A] [-o predest] [-k key1,key2...] files

     -U             : Update in place (default mode)
     -R             : Replace existing with specified set
     -A             : Add to existing tags
     -h             : this (help) message
     -v             : verbose output
     -i             : information only, files will not be modified
     -k k1,k2...    : comma separated list of keywords
     -s c1,c2       : comma separated list of (supplemental) categories
     -S source      : Identifies the original owner of the objectdata
     -b byline      : Name of content creator
     -B bylineTitle : Title of content creator
     -c notice      : A copyright notice
     -r credit      : A credit to the provider of the data (not necessarily the owner)
     -l ISOloc      : The 3 character ISO country code for content (input not validated)
     -L locName     : Full location name for content
     -C countryName : Full country name for content (this is used by most tools including Photoshop)
     -T cityName    : Full town/city name for content
     -P stateName   : Full province/state name for content
     -O subLocName  : Full SubLocation name for content
     -E ReleaseDate : Earliest date provider intends object to be used
                      Format is ISO 8601 (CCYYMMDD, not validated)
     -I instruction : Editorial special instructions concerning use of data, such as embargoes
                      and warnings
     -F fixture     : Keyword used for search/recall (no spaces), e.g. EUROWEATHER
     -H headline    : A publishable synopsis of the content of the object
     -a abstract    : A caption/abstract describing the image
     -o predest     : put updated versions into this directory or use as a prefix for files,
					  by default original files are updated in place

     Notes:
     1. Both Category and SupplementalCategory have been deprecated in the latest standard so
     these are not be supported (supps are support in this version only)
     2. The location code/name automatically populate both the Location and Country IPTC tags

     
    examples:
      settags.pl -i mypic1.jpg /home/data/pics/mypic2.jpg /home/data/pics/d*.jpg
        -- would simply output text readable tag information on all the files

      settags.pl -o new -k art,picture mypic1.jpg
        -- would add art and picture as keys if it not already there and output the file
           as newmypic1.jpg

      settags.pl -o new/ -k art mypic1.jpg
        -- would add art as a key if not already there and output the file
           as mypic1.jpg in the directory ./new

      settags.pl -v -A -L UK -b "Your Name" -k magic,fly mypic*.jpg
        -- would add magic and fly as keys and Your Name as the byline and set the 
           country to UK directly to the files mypics*.jpg.  The files would be modified
           to contain the IPTC data but no image data would be changed

Requirements

This version has been developed around (and tested with) the excellent MetaData library of Stefano Bettelli, bettelli@cpan.org http://search.cpan.org/~bettelli/Image-MetaData-JPEG/ but just in case the library is removed I have a copy of it below. There is a newer version of this library, but I have not yet tested my code against it so I do not support the newer version though my code may well work, if anyone finds out either way please let me know.

In addition the following Perl libraries must be available: Text::ParseWords and File::Basename

My code should work with Perl v4 and above, on my Linux system at home I am on v5.8.7 and all the code has been tested on this version, but have not used anything specific to this version of Perl in the code so it should work with older versions. I cannot state the same for the third party library.

The Source Code

Current version: 1.8
Author: Theodore Zacharia
email: mailto:theodorezacharia@blueyonder.co.uk
Web: http://theodorezacharia.com/index.html

More EXIF info and specs: http://exif.org

Warnings:

  1. Not all of the Image::MetaData library functionality has been tested by me and I take no responsibility for images trashed by any bug therein.
  2. You must properly install the Perl library for Image::MetaData functionality in an appropriate place for your Perl compiler to find it to allow this script to work. If there are problems try changing the use clauses below to point to your library structure

My Code

settags.tar.gz
Some supporting shell scripts are also provided which includes:

The Library

Image-MetaData-JPEG-0.11.tar.gz
Image-MetaData-JPEG-0.159.tar.gz

Other Products

A number of other products support IPTC tags, but of especial use are the following:
Go back to Software
Go to TheoWare

Brought to you by Bluefish