.. _rfc7X: ========================================================================= MS RFC 7X: Adding License Metadata to Output Images ========================================================================= :Date: 2011/06/22 :Author: Paul Ramsey :Contact: pramsey at opengeo.org :Last Edited: $Date$ :Status: Draft :Version: MapServer 6.2 :Id: $Id$ Description: This RFC proposes allowing XML metadata information to be embedded in MapServer output images. The use case is for any organization producing maps that wishes to embed licensing and authorship information directly in the output images. 1. Overview ----------- XMP is the "extensible metadata platform" [1]_ which allows the embedding of metadata information across a wide range of document and image formats: PNG, GIF, JPEG, PDF, etc. XMP was originally developed by Adobe [2]_ and is supported across their product line. It is now being increasingly included in other standards for metadata embedding and supported by tools for viewing image information (e.g. exiftools). Creative Commons has standards for using XMP to embed commons licensing [3]_ in images and other document, including a specific creative commons schema. One of the challenges of advertising licensing and terms of use in WMS and other web mapping services is that the terms are usually advertised separately from the actual content. So a WMS service might specify terms in the Capabilities document, but the images themselves will be unmarked. Embedding license URLs inside the images themselves using a standard marking allows organizations to be unambiguous about the conditions attached to their content. The goal of this change is to allow users the option of embedding XMP metadata in their MapServer output using an open source XMP utility library. 2. Proposed Technical Change ---------------------------- 2.1. Driver Support ------------------- libexempi [4]_ provides a standard C interface for reading and writing XMP content from multiple image formats. One limitation of libexempi (and all other XMP libraries we investigated) is that it only works on existing files. That means that any image that is going to be tagged with metadata must be written to the disk first. Fortunately the GDAL image driver already writes a temporary file to disk for every request, so we propose that XMP support be available only when using the GDAL output format driver. For example:: OUTPUTFORMAT NAME png DRIVER "GDAL/PNG" MIMETYPE "image/png" IMAGEMODE RGB EXTENSION "png" END The XMP metadata embedding code will be called in msSaveImageGDAL just before the temporary file is streamed back to the client. 2.2. Map File Configuration --------------------------- Metadata information is written per-image, so will be stored in the METADATA block of the WEB object in the MAP file. The following tags will be supported, following the tags recommended by Creative Commons [3]_. - xmp_rights_marked ('true' or 'false') indicates whether the image is copyright (true) or public domain (false) - xmp_rights_web_statement (URL) link to a page that explains the terms and conditions under which the image is licensed - xmp_rights_usage_terms (text) a description of the terms and conditions under which the image is licensed. To save image space and ensure licensing is kept up to date, the web statement is preferred over the usage terms. - xmp_cc_license (URL) link to the creative commons license that applies to this image (e.g. http://creativecommons.org/licenses/by-sa/2.0/) - xmp_cc_more_permissions (URL) link to a page describing additional terms and conditions beyond the CC terms - xmp_cc_attribution_url (URL) link to a page of information about the author or organization that produced the content - xmp_cc_attribution_name (text) name of the person or organization that produced the content - xmp_dc_title (text) title of the image - xmp_dc_rights (text) textual description of the license regime of the image For example:: WEB METADATA "xmp_rights_marked" "true" "xmp_cc_license" "http://creativecommons.org/licenses/by-sa/2.0/" "xmp_cc_attribution_url" "http://www.landgate.wa.gov.au/corporate.nsf/web/About+Us" "xmp_cc_attribution_name" "Landgate (landgate.wa.gov.au)" END END 2.3. Build Configuration --------------------------- XMP metadata support will require the presence of the libexempi library. The library must be requested or pointed to directly to using the --with-exempi=[yes|no|path] configuration option in the ./configure script. If --with-exempi is not used, XMP metadata support will not be enabled. 3. Implementation Details ------------------------- 3.1. Files Affected ------------------- The following files will be modified for this RFC:: Makefile.in Makefile.vc mapgdal.c mapxmp.c configure.in configure 3.2. Bug ID ----------- The ticket for RFC 7X (containing proof-of-concept code) can be found here (Bug 3932). 3.3. Documentation ------------------ Documentation for this feature will be added to the appropriate map file documentation (metadata keywords) and a separate howto document will be created explaining XMP metadata. 4. Enhancements --------------- The proposal suggests a set of licensing keywords dictated by Creative Commons, but XMP supports a huge number of other keywords. Allowing generic access to XMP keywords could make the facility more widely useful. 5. Voting history ----------------- None .. [1] http://en.wikipedia.org/wiki/Extensible_Metadata_Platform .. [2] http://www.adobe.com/products/xmp/overview.html .. [3] http://wiki.creativecommons.org/XMP .. [4] http://libopenraw.freedesktop.org/wiki/Exempi .. _3700: http://trac.osgeo.org/mapserver/ticket/3932