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.
UPDATE 2025: The original Perl library my script used is no longer supported but the excellent exiftool does everything we need and
much more, so I have written a script to front end the same options but that simply calls exiftool
to do all the work.
NEW STUFF -- setpictags.sh shell script fronting for exiftool
Options exactly the same as the python script (see below), now we have setpictags.sh
OLD STUFF -- 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
- 'b' => 'ByLine',
- 'B' => 'ByLineTitle',
- 'c' => 'CopyrightNotice',
- 'r' => 'Credit',
- 'S' => 'Source',
- 'l' => 'ContentLocationCode',
- 'L' => 'ContentLocationName',
- 'E' => 'ReleaseDate',
- 'I' => 'SpecialInstructions',
- 'F' => 'FixtureIdentifier',
- 'H' => 'Headline',
- 'a' => 'Caption/Abstract',
- 'C' => 'Country/PrimaryLocationName',
- 'P' => 'Province/State',
- 'O' => 'SubLocation',
- 'T' => 'City',
Multiple value tags (comma separated)
- 'k' => 'Keywords',
- 's' => 'SupplementalCategory',
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
- Update: v1.8, 23rd August 2018, added support for Province/State information (use -P) and SubLocation (use -O)
- Update: v1.5, 25th January 2007, added Country/PrimaryLocationName and City tag support as Photoshop and Microsoft are now supporting these tags
- Update: v1.4, 2nd November 2006, added caption/abstract tag support as the Alamy site and various other sites and products seem to be using this tag
More EXIF info and specs:
http://exif.org
Warnings:
- 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.
- 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:
- addname.sh - a simple shell script which shows how to add a byline, then a location with a byline (just an example script)
- getkeywords.sh - a shell script to find images with a matching set of keywords
- mktagdb.sh - a script to make an XML database of all tags used in a set of photographs
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:
- Picasa by Google, fully supports reading and writing of IPTC tags and much more like GeoCoding and in later (Windows) versions face recognition. It was amazing, some of the most amazing software I have seen with the facial recognition working scarily well, but Google withdrew the locally installable version so
you would have to use their online service to store photos. You can still find the original in various places, here I have a copy of the last released version (picasa39-setup_3.9.141Build159.exe)
or slightly older version here (picasa-3-9-138-150-multi-win.exe) so you can download and enjoy. As I use Linux, I run this (Windows) version (with facial recognition) under Wine, it works perfectly well.
- BreezeBrowser - visual tagger and workflow tool
- Kalimages - build a library of images indexed by IPTC tags, good search facility, can export selection to XML.
- Adobe Lightroom - fully supports IPTC tags and collates them while importing images so you can search the library using a variety of techniques.
- exif - portable C command line based utility for managing EXIF info but also supports IPTC tags, available on POSIX systems (e.g. GNU/Linux, xBSD, MacOS X, etc.) and Win32.
- exiftool - platform independent Perl library / command line based utility for managing EXIF info but also supports IPTC tags, available on Unix, Linux, MacOS and Windows.
- Fav Software Links - links to my fav software for Graphics and such things.
Go back to Software
Go to TheoWare
Brought to you by Bluefish