Sometimes I download images from The Internet™ for later use. For reference I'd like to store some meta data inside the image itself:
The question is now: Which meta data field should I use for those URLs?
Finding the right property
$ exiftool -list -EXIF:All|grep -i url $
|dc:relation||Unordered array of Text||A related resource.|
|dc:source||Text||A related resource from which the described resource is derived.|
Unfortunately there are no "real" URL fields.
|Iptc4xmpCore:Source||Text||The name of a person or party who has a role in the content supply chain.|
The creator's contact information provides all necessary information to get in contact with the creator of this item and comprises a set of sub-properties for proper addressing.
The contact information web address part. Multiple addresses can be given, separated by a comma.
|plus:ImageSupplier||Seq ImageSupplierDetail||Identifies the most recent supplier of the item, who is not necessarily its owner or creator. For identifying the supplier either a well known and/or registered company name or a URL of the company's web site may be used.|
Only Iptc4xmpCore:CreatorContactInfoCiUrlWork sounds like it could be used to identify the web site that linked to the image, but I think it is meant to directly link to the creator's homepage - and not to a random URL that just contains a image tag.
Metadata Working Group
|mwg-coll:CollectionURI||URI||URI describing the collection resource.|
A "collection" in MWG speak is a group of images that this specific image is part of. And a website that links to the image can be seen as such a group.
|dc:source||URL of image that was downloaded|
|dc:relation||URL of website that linked to the image|
Embedding the URLs in the downloaded image is easy with exiftool:
$ wget http://cweiske.de/graphics/bdrem/html.png -O bdrem-html.png $ exiftool -source=http://cweiske.de/graphics/bdrem/html.png\ -relation=http://cweiske.de/bdrem.htm bdrem-html.png Warning: [minor] IPTC:Source exceeds length limit (truncated) 1 image files updated
Despite the warning, the full source URL is stored in the image file. But on JPG files the source is really truncated:
$ exiftool -S -source -relation bdrem-html.jpg Source: http://cweiske.de/graphics/bdrem Relation: http://cweiske.de/bdrem.htm
To work around this issue, we force exiftool to use the XMP source property instead of the IPTC source property:
$ exiftool -XMP:source=http://cweiske.de/graphics/bdrem/html.png\ -XMP:relation=http://cweiske.de/bdrem.htm bdrem-html.jpg 1 image files updated
Extracting the data is also possible:
$ exiftool bdrem-html.png ExifTool Version Number : 9.46 File Name : bdrem-html.png ... MIME Type : image/png Image Width : 463 Image Height : 122 ... Software : Shutter Source : http://cweiske.de/graphics/bdrem/html.png XMP Toolkit : Image::ExifTool 9.46 Relation : http://cweiske.de/bdrem.htm Image Size : 463x122 $ exiftool -S -source -relation bdrem-html.png Source: http://cweiske.de/graphics/bdrem/html.png Relation: http://cweiske.de/bdrem.htm
Adding the meta data manually is possible, but it would be best if they were added automatically when saving-by-right-clicking the image in my brower. Unfortunately, no browser supports this.