Thank you for taking the time to write up your current mapping rules in support of your question. I use PhotoShop to annotate my images, not Lightroom, but the general advice should be similar.
Regarding your comment about IPTC field 2#122, here is what the IPTC Standard says:
2:122 Writer/Editor
Repeatable, maximum 32 octets, consisting of graphic characters plus spaces.
Identification of the name of the person involved in the writing, editing or correcting the objectdata or caption/abstract.
As you can see, the field is limited to 32 characters and is intended to store a person’s name. You might find another field is better for more general Caption purposes. You might also find a more useful field in the EXIF meta data values.
You can use Content Templates to combine metadata elements, supply defaults for missing values and so on. You could build up a Caption from several IPTC fields. Here’s an example Content Template you would put in the “EXIF/Template” text box on the IPTC/EXIF page:
template:([+iptc:object-name+] — ([+iptc:sub-location+], )([+iptc:city+], )([+iptc:province-or-state+], )([+iptc:country-or-primary-location-name+]))
All those parentheses are optional; they ensure that missing values are quietly ignored along with their punctuation. For example, if the sub-location wasn’t filled in, the comma and space after it would also be dropped. You can find more information about templates in the “Content Templates” section of the Settings/Media Library Assistant Documentation tab.
You can use the special “ALL_IPTC” or “ALL_EXIF” pseudo values to discover which IPTC/EXIF fields are populated in your images.
You can quickly see the data available in your images by coding something like:
[mla_gallery ids=272 mla_caption=”{+exif:ALL_IPTC+}” columns=1]
[mla_gallery ids=272 mla_caption=”{+exif:ALL_EXIF+}” columns=1]
The ALL_IPTC and ALL_EXIF pseudo values will dump all of the information in the image so you can see what’s in there. In this example, ids=272 is a quick way to select a specific attachment for the gallery; you can use any data selection parameters that you like.
You can also use the pseudo values in the EXIF/Template textbox of an IPTC/EXIF mapping rule or code [+exif:ALL_IPTC+]
as a Template Data Source for a Custom Fields mapping rule.
I put your question out to a couple of Lightroom users and one of them sent this response:
I’m assuming this person wants to ingest metadata from images into WP that was written to the images by Lightroom. The biggest challenge is going to be figuring out how to get access to every one of the available metadata fields that Lightroom writes to the image. Sometimes fields are stored in IPTC headers (Core or Extended), sometimes EXIF, other times XMP, and sometimes even more than one. There’s also Dublin Core, but I’m not sure if Lightroom uses it. And sometimes fields in one metadata standard don’t cleanly map to fields in another standard. For example, Copyright, Description, Creator, and Date & Time are all mapped differently between IPTC, EXIF, and XMP. (See: https://www.foto-biz.com/Lightroom/Exif-vs-iptc-vs-xmp). I’m sure there are other instances of this type of inconsistency.
Essentially there are 5-6 major metadata ‘standards’ – EXIF, DCF (Dublin Core), ITPC Core, IPTC Extended, and XMP. Then Adobe has its own extensions. And each maps various metadata fields in different ways even though there are supposed to be standards for the various field mappings.
To my knowledge Adobe doesn’t provide any documentation as to how one would extract the metadata that Lightroom writes to the image via various tools like PHP or other languages, or how Lightroom’s metadata fields would map to “standard” IPTC, IPTC Extended, EXIF, or XMP fields.
If I were doing this I would first try to fill every possible metadata field in Lightroom with some text, then export the image from LR with all metadata intact. Then I would try to extract every single one of those metadata fields via PHP or other tools in an attempt to determine how Lightroom is storing the various metadata fields in the images. From there it’s just a matter of deciding how one wants to map & insert those fields into WordPress.
XMP & PHP:
https://stackoverflow.com/questions/1578169/how-can-i-read-xmp-data-from-a-jpg-with-php
IPTC & PHP:
https://php.net/manual/en/function.iptcparse.php
EXIF & PHP:
https://php.net/manual/en/function.exif-read-data.php
In a quick search I can’t find any guidance on how to access Dublin Core metadata via PHP (it may be that Dublin Core isn’t used for image metadata…)
Hope that helps.
-t
The current MLA version does not support access to XMP meta data in images (although it does for PDF documents). If you find a compelling reason for using XMP meta data in your images, let me know and I will consider developing support in MLA.
I hope that gets you closer to the mapping results you want. I am marking this topic resolved, but please update it if you have problems or further questions about accessing IPTC/EXIF meta data in MLA. Thanks for your interest in the plugin.