Metadata Read/Write Mapping

ResourceSpace is able to map between embedded metadata stored in your original files and the metadata fields in ResourceSpace itself. This synchronisation can be two way, so that imported metadata can be automatically extracted into a configured field, but also that metadata added to the resource after import is written back to the file at download.

Mapping metadata when using the ExifTool utility

ResourceSpace makes use of the open source ExifTool utility to read and write metadata. This is extremely flexible and any metadata present in a file can be mapped to ResourceSpace fields. Many different profiles are supported in addition to Exif, including XMP, IPTC, GPS, JFIF, GeoTIFF, ICC Profile, Photoshop IRB, FlashPix, AFCP and ID3.

You must have ExifTool (a command-line interface to a PERL library) installed and enabled (the path must be specified) in config.php or auto-detected during the setup routine.

In order to map an IPTC/Exif/XMP tag name to a ResourceSpace field, you can enter ExifTool-supported tag name(s) in the "Exiftool_Field" box in the metadata field settings.

Here are some example mappings. Your default installation will probably have these and more already set up.

RS Field Exiftool_field Tags
Title Title
Keywords Keywords
Caption Caption-Abstract,Description,ImageDescription
Country Category,Country
Named Persons People
Rating Rating
Credit Source,Creator,Credit,By-line
Camera Make/Model Model
Notes JobID

See ExifTool documentation to look up tag names. It fully supports read/writing of several filetypes including JPG, GIF, PNG, TIF, EPS, PDF. It can also read data from other filetypes that are not write-supported. <--good documentation of command-line capabilities

Do "exiftool -listw" on the command line for a list of writable fields. Any of those names could be used in the exiftool_field in RS to develop your ideal read/write mapping.

Do "exiftool -s [filename]" to get a report of existing metadata in an image. For example, if you have files with metadata in them and would like to upload them to RS and index that information, you should be able to work out some appropriate mappings from the metadata report.

Remember that some fields may not be available for a particular filetype, for example JobID will not write to a PDF file. If you need "Notes" to be written to PDF files, you will have to find a PDF-writable field in addition to JobID. The reason for using multiple fields is that certain programs look for information in a specific place. For example if Photoshop gets the caption from Caption-Abstract and another program you use gets it from ImageDescription, you need to have your ResourceSpace caption in both. It may take some experimentation to get the combination that best suits your workflow.

Of course you can also create your own custom fields and mappings. One such use may be to embed a weblink in the metadata of your images. You simply create an ResourceSpace field, for example "URL" and in the Exiftool_field you enter "WebStatement", a field which can be found in ExifTool's list of writeable fields and is appropriate for data of that type.

Read-only metadata fields

Version 9.1+

ResourceSpace can have certain metadata fields set as read-only. This will determine whether the field should be written back to the files on download.

This is determined under Admin > System > Manage metadata fields area. A Super Administrator will enable this for all fields that should be read-only by selecting the option Read-only metadata field (ie. will not write back on Download).

Please note that this option will only affect embedded metadata, not to be confused with CSV exported metadata. Fields included in a CSV export are determined using the field option 'Include in CSV export' and will be included in the CSV sheet irrespective of user access or exif read/write settings.

Example configuration and expected behaviour

$exiftool_write                = true;
$force_exiftool_write_metadata = true;
$exiftool_write_option         = true;
$exiftool_remove_existing      = true;

With the above configuration ResourceSpace will force the writing on download of the values ascribed to the resource within ResourceSpace. However for fields set as read-only no value will be embedded on download.

Please note the above configuration is using the remove_existing option. If this is set to false the original field value will be embedded in the file on download, rather than any value added to the resource by edits within ResourceSpace.

Mapping Exif / IPTC without Exiftool

If you have not installed Exiftool, ResourceSpace still supports the reading of some basic EXIF fields and all IPTC fields when resources are uploaded. For anything other than the most basic metadata support it is best to use ExifTool as described above.

Without ExifTool, ResourceSpace will not write altered metadata back to files on download.

Exif fields are mapped using the $exif_* settings in include/config.php.

IPTC fields are mapped using the 'IPTC Equiv.' option on each field in System Setup. The codes you need are as follows:

IPTC Equiv. value Metadata field extracted
2#120 Caption
2#025 Keywords
2#055 Creation Date
2#040 Special Instructions
2#085 Credit Byline Title
2#101 Country
2#105 Headline
2#110 Source
2#115 Photo Source
2#120 Caption
2#090 City
2#095 State