...
It has extensive documentation and you can also run exiftool with no arguments for a complete list of available options with examples.
...
Examples of reading IPTC metadata from the command line using exiftool
To get you started quickly, here are some examples of things that can be done with it regarding IPTC metadata :(we cover writing these fields below)
View all embedded metadata for an image file
...
View all properties read by Google Image Search for the Licensable badge feature
To read more than one property from a file, simply specify multiple Exiftool tags, each prefixed with a dash/hyphen character.
Code Block |
---|
% exiftool -XMP-dc:creator -XMP-photoshop:Credit -XMP-dc:rights -XMP-xmpRights:WebStatement -XMP-plus:LicensorURL IPTC-GoogleImgSrcPmd_testimg01.jpg Creator : Jane Photosty Credit : IPTC/Jane Photosty Rights : © Copyright 2020 IPTC (Test Images) - www.iptc.org Web Statement : https://iptc.org/tests/copyright-and-licenses-of-images-test-page/ Licensor URL : https://iptc.org/tests/licensing-of-images-test-page/ |
...
Code Block |
---|
$ exiftool -b -xmp IPTC-PhotometadataRef-Std2021.1.jpg <?xpacket begin='' id='W5M0MpCehiHzreSzNTczkc9d'?> <x:xmpmeta xmlns:x='adobe:ns:meta/' x:xmptk='Image::ExifTool 12.34'> <rdf:RDF xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'> <rdf:Description rdf:about='' xmlns:Iptc4xmpCore='http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/'> Iptc4xmpCore:AltTextAccessibility rdf:Alt <rdf:li xml:lang='x-default'>This is the Alt Text description to support accessibility in 2021.1</rdf:li> </rdf:Alt> </Iptc4xmpCore:AltTextAccessibility> <Iptc4xmpCore:CountryCode>R21</Iptc4xmpCore:CountryCode> [... much more data snipped for brevity ...] </xmpRights:UsageTerms> <xmpRights:WebStatement>http://www.WebStatementOfRights.org/2021.1</xmpRights:WebStatement> </rdf:Description> </rdf:RDF> </x:xmpmeta> |
...
Anchor | ||||
---|---|---|---|---|
|
The same exiftool versions of XMP tags can be used to write metadata to image files on the command line.
Info |
---|
Note that by default when writing to an image file using exiftool on the command line |
...
, the original unaltered version of the image is backed up as <filename>_original, for example |
Writing Digital Source Type for synthetic media
Note that the value can be any text string, but we recommend using a full URI from the IPTC Digital Source Type vocabulary:
...
(Note that Google’s documentation on Digital Source Type for synthetic media specifies using only the valueID, not the full URI. So if you are writing software to read these values, we recommend that you support both formats.)Writing Licensorthe fully-expanded URI and the short ID.)
Writing Creator and Credit Line metadata
The contents of these fields will be displayed in the Google Images search results details panel.
Code Block |
---|
% exiftool -XMP-dc:creator="Jane Smith" -XMP-photoshop:Credit="Jane Smith, Smith Photography Ltd" -XMP-dc:rights="Copyright Smith Photography Ltd 2023" -XMP-xmpRights:WebStatement="http://smithphotography.com/licensing/" -XMP-plus:LicensorURL="http://www.mypictureagency.com/obtain-licence/" -XMP-iptcExt:DigitalSourceType="https://cv.iptc.org/newscodes/digitalsourcetype/digitalCapture" test-image.jpg
1 image files updated
brendan@Brendans-M1-MacBook-Pro pmd-sample-images % exiftool -XMP-dc:creator -XMP-photoshop:Credit -XMP-dc:rights -XMP-xmpRights:WebStatement -XMP-plus:LicensorURL -XMP-iptcExt:DigitalSourceType test-image.jpg
Creator : Jane Smith
Credit : Jane Smith, Smith Photography Ltd
Rights : Copyright Smith Photography Ltd 2023
Web Statement : http://smithphotography.com/licensing/
Licensor URL : http://www.mypictureagency.com/obtain-licence/
Digital Source Type : https://cv.iptc.org/newscodes/digitalsourcetype/digitalCapture |
Writing Licensor URL metadata
This triggers the “Get this image on…” text in Google Images search results.
Code Block |
---|
% exiftool -XMP-plus:LicensorURL=http://www.mypictureagency.com/obtain-licence/ test-image.jpg
1 image files updated |
Writing Web Statement of Rights metadata
This triggers the “Licensable” badge in Google image search results.
Code Block |
---|
% exiftool -XMP-xmpRights:WebStatement="http://smithphotography.com/licensing/" test-image.jpg
1 image files updated
brendan@Brendans-M1-MacBook-Pro pmd-sample-images % exiftool -XMP-xmpRights:WebStatement test-image.jpg
Web Statement : http://smithphotography.com/licensing/ |
Writing all metadata that can be read by Google Search
Code Block |
---|
% exiftool -XMP-dc:creator="Jane Smith" -XMP-photoshop:Credit="Jane Smith, Smith Photography Ltd" -XMP-dc:rights="Copyright Smith Photography Ltd 2023" -XMP-xmpRights:WebStatement="http://smithphotography.com/licensing/" -XMP-plus:LicensorURL="http://www.mypictureagency.com/obtain-licence/" -XMP-iptcExt:DigitalSourceType="https://cv.iptc.org/newscodes/digitalsourcetype/digitalCapture" test-image.jpg
1 image files updated
brendan@Brendans-M1-MacBook-Pro pmd-sample-images % exiftool -XMP-dc:creator -XMP-photoshop:Credit -XMP-dc:rights -XMP-xmpRights:WebStatement -XMP-plus:LicensorURL -XMP-iptcExt:DigitalSourceType test-image.jpg
Creator : Jane Smith
Credit : Jane Smith, Smith Photography Ltd
Rights : Copyright Smith Photography Ltd 2023
Web Statement : http://smithphotography.com/licensing/
Licensor URL : http://www.mypictureagency.com/obtain-licence/
Digital Source Type : https://cv.iptc.org/newscodes/digitalsourcetype/digitalCapture |
Appending to an existing set of repeatable tags
exiftool allows appending to a repeatable list of tags, for example Image Creator (dc:creator):
Code Block |
---|
% exiftool '-XMP-dc:creator+=New Creator' test-image.jpg
1 image files updated
% exiftool -XMP-dc:creator test-image.jpg
Creator : Creator 1, Creator 2, New Creator |
Would you like more examples? Just ask!
If you would like to see other exiftool examples, or if you have suggestions of exiftool incantations that you find useful and you would like to share them with others, please let us know!