Mapping problem for Subject>Title, Description, Alternating Text
-
Hi
I would like to use Media Library Assistant (MLA) to map the value of the XMP “Subject” field in my JPGs to the “Title”, “Alternating text” and “Description” fields in WordPress.
I’ve tried to use the standard mapping fields under IPTC/EXIF with the following settings for each of the three mentioned WordPress fields:
IPTC Value=Default, no value selected
EXIF Value/Map Value=template:([+xmp:Subject+])
Priority=EXIF
Existing Text=ReplaceMy WordPress installation is not in English so I have to excuse any poor translation of the actual WordPress GUI.
When editing an image in WordPress and pressing the mapping button, the mentioned fields are not filled with anything.
-
This topic was modified 8 years, 11 months ago by
victorborgvall.
-
This topic was modified 8 years, 11 months ago by
-
Thanks for your question and for the details of your mapping rules; very helpful.
The
xmp:Subjectvalue is an MLA “enhanced” value, created to make XMP metadata for images similar to that for PDF documents. MLA looks for a value in the “description” field of the “dc” namespace and copies the value toxmp:Subject. The most common cause of empty results is a lack of data in the image metadata.If you can post a link to one or more of your images I can analyze them and see if there is data you can use for your Subject. Any example images and additional information you can provide will be very helpful. Thanks for your interest in the plugin.
I’m the one who should thank you David for taking the time to help people. My wife is getting tired of me trying to solve this during the evenings…
Here is a screenshot of the settings that I’ve tried: http://www.borgvall.com/screenshot-from-2017-05-22-20-58-55
Are there any particular settings that are needed on the first tab, General, that I need to do for this to work?I’m tagging and exporting photos using Darktable and here is an export straight from Darktable with the subject values “Malte” and “Universeum”: http://www.borgvall.com/_3064650-straight-from-darktable
I can use ExifTool to copy the subject values to the Description field (or any field, I guess) as done with this file: http://www.borgvall.com/_3064650-copied-subject-to-description-using-exiftool
Then, in this case, WordPress at least seems to name the file “Malte, Universeum”.I’m looking forward to your reply.
Thanks for your update and for posting the links to your screen shot and example images; exactly what I needed.
As I suspected, you can get the results you want by finding and using the right XMP element. Your examples are an excellent illustration of what is needed.
Your “straight-from-darktable” image includes the “subject” element in the “dc” namespace. It contains a two-element array with “Malte” and “Universem” as separate strings. There is no “description” element in the “dc” namespace for this image.
Your “copied-subject-to-description-using-ExifTool” image adds the “description” element to the “dc” namespace, as you wrote. It contains a single value, “Malte, Universem”. This “description” value is used by MLA to populate the
[+xmp:Subject+]value.You can use
[+xmp:dc.subject+]to access the original array and return a comma-separated string. The confusion is that “dc.subject” and “Subject” are completely different values despite the similar names. You won’t need ExifTool if you can find the proper way to access the data already in the image file.The dc.subject array (or its lr.hierarchicalSubject array equivalent) is really a list of individual keywords describing the image. You will often see the same data in the IPTC “2#025 keywords” element when images contain IPTC metadata. MLA will copy the dc.subject array to the “xmp:Keywords” element, so you could also use
[+xmp:Keywords+]to get the value you want.I hope the above explanation makes sense and the suggestions are helpful. I am marking this topic resolved, but please update it if you have any problems or further questions regarding the solutions I outlined.
I’m afraid it still doesn’t work. I’ve tried the following:
[xmp.lr.hierarchicalSubject+]
[+xmp:Subject+]
[+Xmp:dc.subject+]
[+Xmp.dc.subject+]
[+xmp:subject+]After adding them to the EXIF fields in the standard field mapping part in MLA, I’ve pressed the mapping of IPTC/EXIF with meta data, on the edit page, for each of the two photos. I’ve also tried to re-upload the photos.
Is there any more settings that are needed?
Again, thanks for your time.
Thanks for your efforts and for posting all of the combinations you’ve tried. You are so close, but each of the above examples has a slight error. The rules are:
- The “xmp” prefix is case-sensitive, so “Xmp” will not work. This is silly, and I will change the next MLA version to remove the case-sensitivity. Thanks for bringing it to my attention.
- The separator between the prefix and the element name must be “:”.
- The element names are case-sensitive, so “xmp:subject” will not match “Subject”. EXIF and XMP elements are case-sensitive so this is a requirement.
If you apply all the rules you should have success with:
[+xmp:lr.hierarchicalSubject+] [+xmp:Subject+] [+xmp:dc.subject+]Let me know if that works for you. Thanks for your persistence!
Neither of the following worked:
[+xmp:lr.hierarchicalSubject+] [+xmp:Subject+] [+xmp:dc.subject+]The thing that confused me is that my image viewer Geeqie writes Xmp with a capitalized X.
Is there anything more we can try? I assume there is no other setting that I have to change, except getting this mapping right.
The attachment meta data might give any clue.
array (
‘width’ => 900,
‘height’ => 1200,
‘file’ => ‘3064650-straight-from-Darktable-2.jpg’,
‘sizes’ =>
array (
‘thumbnail’ =>
array (
‘file’ => ‘3064650-straight-from-Darktable-2-113×150.jpg’,
‘width’ => 113,
‘height’ => 150,
‘mime-type’ => ‘image/jpeg’,
),
‘medium’ =>
array (
‘file’ => ‘3064650-straight-from-Darktable-2-580×773.jpg’,
‘width’ => 580,
‘height’ => 773,
‘mime-type’ => ‘image/jpeg’,
),
‘medium_large’ =>
array (
‘file’ => ‘3064650-straight-from-Darktable-2-768×1024.jpg’,
‘width’ => 768,
‘height’ => 1024,
‘mime-type’ => ‘image/jpeg’,
),
‘featured’ =>
array (
‘file’ => ‘3064650-straight-from-Darktable-2-580×200.jpg’,
‘width’ => 580,
‘height’ => 200,
‘mime-type’ => ‘image/jpeg’,
),
),
‘image_meta’ =>
array (
‘aperture’ => ‘2.8’,
‘credit’ => ‘Victor Borgvall’,
‘camera’ => ‘E-M5’,
‘caption’ => ”,
‘created_timestamp’ => ‘1488813562’,
‘copyright’ => ‘Victor Borgvall’,
‘focal_length’ => ’30’,
‘iso’ => ‘3200’,
‘shutter_speed’ => ‘0.016666666666667’,
‘title’ => ”,
‘orientation’ => ‘1’,
‘keywords’ =>
array (
),
),
)Additionally, I wonder, should I write “template” or something before your suggestions?
Thanks for your updates. You wrote “Additionally, I wonder, should I write “template” or something before your suggestions?“.
I regret that my earlier suggestions were incomplete. Yes, the Bulk edit fields look for a Content Template and you must start your entry with the “template:” prefix, e.g.:
template:[+xmp:dc.subject+]You can find more information and an example in the “Bulk Actions” section of the Media/Assistant Help menu. Click on “Help” in the upper-right corner of the screen and then “Bulk Actions” in the tab list at the left of the dropdown area. You will also find a link to the “Content Template” section of the Settings/Media Library Assistant Documentation tab with more information about content templates.
template:[+xmp:dc.subject+]
and
template:[+xmp:lr.hierarchicalSubject+]
work.Thanks a million David.
Thanks for the good news! Thanks as well for sticking with me until I figured out all of the details you needed to get to a solution. If there’s anything more I can do to help you get the most out of MLA (and reclaim your evenings), let me know.
The topic ‘Mapping problem for Subject>Title, Description, Alternating Text’ is closed to new replies.