Open main menu

CDOT Wiki β

Changes

Cc-xmp-tag.pl

2,210 bytes added, 19:17, 8 April 2015
no edit summary
It's using the perl Image::ExifTool module, which means you need that installed on your system. On Debian derivatives you can install it like this:
<codepre>apt-get install libimage-exiftool-perl</codepre>
== Usage examples ==
There are a couple of sample .jpg files in the repository next to cc-xmp-tag.pl: example-alltags.jpg and example-notags.jpg. You can use them for testing if you like.
These XMP tags are supported(don't worry about capitalization, they are set correctly):
* '''AttributionName''': the name of the author of the work.
* '''Title''': the title of the work.
* '''Marked''': if this is true that means the work is not in the public domain. Set automatically when you write any other tags.
* '''UsageTerms''': a human-readable note saying that a licence applies to this work. Set automatically when you write the '''LicenceLicense''' tag.
=== Reading XMP ===
Use a variation of <code>cc-xmp-tag.pl --read filename </code> with a list of tags you want to read.For example: * Read the AttributionName tag (prints out the contents of the tag or nothing). Note that this will not be very useful output for software to parse because if any of the tags are missing you won't know which tags the printed values belong to:<pre>$ ./cc-xmp-tag.pl --read example-alltags.jpg AttributionNameAndrew Smith$ ./cc-xmp-tag.pl --read example-notags.jpg AttributionName</pre>* Read all the tags or multiple tags:<pre>$./cc-xmp-tag.pl --read example-alltags.jpg ALLAndrew Smithhttp://littlesvr.cahttps://creativecommons.org/licenses/by-sa/4.0/TrueMy TitleThis work is licensed under a &lt;a rel=&#34;license&#34; href=&#34;https://creativecommons.org/licenses/by-sa/4.0/&#34;&gt;Creative Commons Attribution-ShareAlike 4.0 International License&lt;/a&gt;.$ ./cc-xmp-tag.pl --read example-alltags.jpg License Title AttributionNamehttps://creativecommons.org/licenses/by-sa/4.0/My TitleAndrew Smith$ ./cc-xmp-tag.pl --read example-notags.jpg License Title AttributionName</pre> === Writing XMP === All the same tags are supported, though there's no need to set Marked and UsageTerms. Variations of <code>cc-xmp-tag.pl --read filename</code>: * Set a couple of tags on an image that had none to begin with and check what was set: <pre>$ ./cc-xmp-tag.pl --write example-notags.jpg AttributionName='Andrew Smith' License='BY-SA'$ ./cc-xmp-tag.pl --read example-notags.jpg ALLAndrew Smithhttps://creativecommons.org/licenses/by-sa/4.0/TrueThis work is licensed under a &lt;a rel=&#34;license&#34; href=&#34;https://creativecommons.org/licenses/by-sa/4.0/&#34;&gt;Creative Commons Attribution-ShareAlike 4.0 International License&lt;/a&gt;.</pre> Note that when writing the License you have to use the licence code, not the URL. When reading you get the URL. Also note that the values you set are stored in XML - which means you aren't allowed to have ASCII control characters or '<', '>', '&'. You can't have single or double-quotes in attributes either but cc-xmp-tag.pl doesn't store values in attributes so I wouldn't worry about that (you're welcome O'Connors of the world). [[Category:CC]]