Storing metadata in files
Creative Commons
The non-profit Creative Commons organization distributes a variety of easily applicable free licenses for digital works [17] that artists and authors worldwide use to protect their copyrights. Creative Commons recommends XMP as a metadata format. At the same time, the organization posts guidelines on how artists can best utilize the information of the license they use [18] and embed this in their published files. This creates a win-win situation: The license strengthens the position of the author, and the users establish the license conditions in an uncomplicated and reliable way from the objects themselves.
Creative Commons has defined the XML namespace http://creativecommons.org/ns# for XMP, as well as for other purposes; this includes the following four elements cc:license
, cc:morePermissions
, cc:attributionURL
, and cc:attributionName
. The XMP Toolkit makes this namespace available under the consts.XMP_NS_CC
key. Furthermore, the organization recommends the use of the two elements xmpRights:Marked
and xmpRights:UsageTerms
from the XMP rights management schema (Table 1).
A copy of the license notice should also (according to their advice) end up in dc:rights
. Listing 3 shows a Python script that writes the metadata recommended by Creative Commons into a JPG file (not yet containing an XMP packet) with XMP Toolkit for the Attribution-ShareAlike 4.0 license. The result of these efforts is presented in Listing 4.
Listing 3
Generating Creative Commons-Compliant Metadata
Listing 4
Created XMP Package
The xmpRights:WebStatement
text element transports a callable URL, by which details regarding the authorship and conditions of use of a file can be verified. The Creative Commons creators suggest installing a reference under the address given here that also contains the hash value of the published file [19]. In this case, it can be manually or automatically compared to raise the alarm in case of forgeries.
Conclusion
XMP involves a sophisticated and professional metadata system that compiles schemas for different objects and applications. The comprehensive set of descriptive components can even be expanded with elements not provided by the specification.
XMP supports a wide range of file formats in which to embed metadata packets; it is only on exceptional occasions that no solution exists. Nothing else is comparable, especially when it comes to PDF documents, although this is not surprising considering the standard's author (Adobe).
End users can request XMP metadata with ease from the command line, and programmers can develop special XMP applications with a range of C/C++ libraries. Python bindings are available for the existing XMP and Exif libraries, which can also handle XMP.
Exiftool (in the libimage-exiftool-perl Debian package or perl-image-exiftool package for openSUSE and others) and the command-line tool from the Exiv2 library (in the Debian exiv2 package) are also useful for editing XMP data at the command line.
Infos
- Exif specification: http://www.cipa.jp/std/documents/e/DC-008-2012_E.pdf
- XMP specification: http://www.adobe.com/devnet/xmp.html
- XMP ISO standard press release: http://www.iso.org/iso/home/news_index/news_archive/news.htm?refid=Ref1525
- MWG guidelines: http://www.metadataworkinggroup.com/specs
- RDF 1.1 XML syntax: https://www.w3.org/TR/rdf-syntax-grammar
- DCMI metadata terms: http://dublincore.org/documents/dcmi-terms/
- Python XMP Toolkit in GitHub: https://github.com/python-xmp-toolkit/python-xmp-toolkit/
- Exempi: https://libopenraw.freedesktop.org/wiki/Exempi/
- Pyexiv2: http://tilloy.net/dev/pyexiv2/
- Exiv2: http://exiv2.org
- GExiv2: https://wiki.gnome.org/Projects/gexiv2
- PyGObject: https://wiki.gnome.org/Projects/PyGObject
- Python XMP Toolkit in PyPI: https://pypi.python.org/pypi/python-xmp-toolkit/
- XMP Toolkit documentation: http://python-xmp-toolkit.readthedocs.org/en/latest/
- Debian packages: https://packages.qa.debian.org/p/python-xmp-toolkit.html
- Python datetime library: https://docs.python.org/2/library/datetime.html
- Creative Commons licensing types: https://creativecommons.org/share-your-work/licensing-types-examples/
- Creative Commons XMP properties: https://wiki.creativecommons.org/wiki/XMP
- WebStatement: https://wiki.creativecommons.org/wiki/Web_Statement
« Previous 1 2 3
Buy this article as PDF
(incl. VAT)
Buy Linux Magazine
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters
Support Our Work
Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.
News
-
Gnome 48 Debuts New Audio Player
To date, the audio player found within the Gnome desktop has been meh at best, but with the upcoming release that all changes.
-
Plasma 6.3 Ready for Public Beta Testing
Plasma 6.3 will ship with KDE Gear 24.12.1 and KDE Frameworks 6.10, along with some new and exciting features.
-
Budgie 10.10 Scheduled for Q1 2025 with a Surprising Desktop Update
If Budgie is your desktop environment of choice, 2025 is going to be a great year for you.
-
Firefox 134 Offers Improvements for Linux Version
Fans of Linux and Firefox rejoice, as there's a new version available that includes some handy updates.
-
Serpent OS Arrives with a New Alpha Release
After months of silence, Ikey Doherty has released a new alpha for his Serpent OS.
-
HashiCorp Cofounder Unveils Ghostty, a Linux Terminal App
Ghostty is a new Linux terminal app that's fast, feature-rich, and offers a platform-native GUI while remaining cross-platform.
-
Fedora Asahi Remix 41 Available for Apple Silicon
If you have an Apple Silicon Mac and you're hoping to install Fedora, you're in luck because the latest release supports the M1 and M2 chips.
-
Systemd Fixes Bug While Facing New Challenger in GNU Shepherd
The systemd developers have fixed a really nasty bug amid the release of the new GNU Shepherd init system.
-
AlmaLinux 10.0 Beta Released
The AlmaLinux OS Foundation has announced the availability of AlmaLinux 10.0 Beta ("Purple Lion") for all supported devices with significant changes.
-
Gnome 47.2 Now Available
Gnome 47.2 is now available for general use but don't expect much in the way of newness, as this is all about improvements and bug fixes.