Fork me on GitHub

Usage

Basic Arguments

To map the content of a G2 document mydoc related to a given image myimage the command line tool can be called as follows:

java -jar target/metadata-mapper-${project.version}.jar -i myimage -d mydoc -o result.jpeg

This maps the content of mydoc using the default mapping rules into the image myimage and stores the resulting image as result.jpeg.

Custom Mappings

If you want to override certain rules of the default mapping you have to provide a custom mapping myrules. This mapping can be specified via switch -m:

java -jar target/metadata-mapper-${project.version}.jar -m myroles -i myimage -d mydoc -o result.jpeg

Empty Containers in Advance

To empty all target container before the mapping you may use the switch -e:

java -jar target/metadata-mapper-${project.version}.jar -e -m myroles -i myimage -d mydoc -o result.jpeg

List of Options

Simply call java -jar target/metadata-mapper-${project.version}.jar -h`:

** MetadataMapper - Copyright (c) 2015 dpa Deutsche Presse-Agentur GmbH
Usage: de.dpa.oss.metadata.mapper.MetadataMapperCmd
  -inputImage                 (-i) [String] Filename of input image
  -outputImage                (-o) [String] Filename of resulting image
  -g2doc                      (-d) [String] Filename of input G2 document
  -validateMapping            (-v) [String] Validate given mappingCustomization file
  -mappingCustomization       (-m) [String] Mapping customization file which is used to
                                            override and/or enhance the default
                                            mappingCustomization. By default it uses dpa
                                            mappingCustomization
  -printCharacterMappingTable (-c) [flag]   Outputs configured character
                                            mappingCustomization table. Does not perform
                                            any mappingCustomization. Uses default
                                            mappingCustomization file if argument -m
                                            is omitted
  -exiftoolPath               (-t) [String] Path to exiftool. Alternatively you may set
                                            environment variable EXIFTOOL
  -emptyTagGroupBeforeMapping (-e) [flag]   Removes all tags from those tag groups which
                                            are
                                            used by the mappingCustomization. By default
                                            mapped tag values will be merged with
                                            existing tags
  -removeTagGroups            (-r) [String] Comma separated list of metadata tag groups
                                            to clear before mapping. The syntax needs
                                            to match the exiftool syntax to specify
                                            containers: TAG_GROUP:TAG.
                                            For a list of available containers see
                                            exiftool. Example: -r IPTC:ALL,XMP:XMP-dc
  -removeAllTagGroups         (-R) [flag]   Removes all metadata from given file before
                                            processing
  -explainMapping             (-x) [flag]   Experimental feature: Dumps mapping
                                            information based on a given document.
                                            At present state the output for XMP is not
                                            complete
  -help                       (-h) [flag]