MoreGallery automatically extracts IPTC data from an image on upload and import, since v1.4. With the
moregallery.prefill_from_iptc system setting enabled, it will also automatically pre fill image data from the IPTC information.
A collection of known keys are normalised, as detailed below.
2#005) Used to pre fill the image name on upload/import
2#015) Used to pre fill image tags
2#020) Used to pre fill image tags
2#025) Used to pre fill image tags
2#105) Used to pre fill the image name
2#120) Used to pre fill the image name
Any IPTC keys that are not in the list above are available through their numerical key in your templates.
Identifying available data
To see what IPTC data has been extracted from an image, you can use the
[[+iptc_json]] placeholders in the chunk called by the
&imageTpl property on the mgGetImages snippet.
For example, you might temporarily add this to your chunk to see what's available for each image:
which might show something like this:
Array ( [1#090] => %G [2#000] => [Urgency] => 0 [CreationDate] => 20140913 [Copyright] => Copyright 2008-2014, SomeOne [Category] => category or tag )
To then use one of these values in your template, you would use the
[[+iptc.KeyHere]] placeholder, for example like so:
Processing IPTC Data with a Snippet
To do more processing with the IPTC data, you can use the
[[+iptc_json]] placeholder to get a JSON encoded object with all IPTC data extracted by MoreGallery. You can decode this data in a snippet using