Support » Plugin: Media Library Assistant » ALT Text with EXIF xpcomments,xptitle,xpkeywords

  • Resolved dkifiak



    I am trying to to get the alt text working on my images. My images contain exif data xptitle,xpcomments,xpauthor,xpkeywords. I have tried many ways of trying to get the alt text to map to these fields without success.

    I referenced this thread

    Does a new template need to be created?

Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Author David Lingren


    Thanks for your question. I want to make sure what your issue is.

    You wrote “I am trying to get the alt text working on my images.

    Are you trying to copy the value(s) from one or more of “xptitle, xpcomments, xpauthor, xpkeywords” from the image files to the WordPress ALT Text field? MLA provides an IPTC/EXIF mapping rule for this purpose. If you are trying to adapt this rule to your images it would be helpful to see the rule details.

    You asked “Does a new template need to be created?” MLA provides custom markup templates for use with the [mla_gallery] shortcode. If the ALT Text value is present in your items it should appear automatically in the links associated with each gallery item. Is that what you intend?

    You wrote “My images contain exif data xptitle, xpcomments, xpauthor, xpkeywords.” Those are unusual names for EXIF fields. You can see the names MLA uses to reference your metadata values in the “Attachment File Metadata” text box in the Media/Edit Media screen for an item. You might see something like `xmp:title” there. If you can post the content of that text box or a link to one of your image files I can investigate further.

    Any additional details you can provide will help me give you more specific guidance. I will leave this topic unresolved and hope to see an update from you soon. Thanks for your interest in the plugin.

    Thread Starter dkifiak


    Thank you for the quick reply. The reference MAN page for exif on ubunutu is here:

    Which contains defintions for exif data xptitle, xpcomments, xpauthor, xpkeywords, etc. This is not how I named them, and are not unusual. Originally, the images are created in windows then imported into wordpress on ubuntu, which inputs the data into the xp* fields.

    I want to associate the xp* data into the alt text field on the MLA iptc/exif tab. I would like to use a combination of xptitle, xpcomments, and xpkeywords to update the alt=”” on my images being imported.

    The data in MLA has some weird characters below

    exif:Title => New 52: Futures End 3 2014 DC Back Issue Comics
    exif:Comments => 9�.�4� �N�M� �D�e�a�t�h� �o�f� �B�a�t�m�a�n� �B�e�y�o�n�d�;�T�i�m� �D�r�a�k�e� �b�e�c�o�m�e�s� �B�a�t�m�a�n�;���
    exif:Keywords => Cool Comic Cover Dan Jurgens Key Comic 9.4 NM
    exif:Subject => DC Back Issue Comics`

    However for windows it appears correct
    exif:WINXP.Comments => 9.4 NM Death of Batman Beyond;Tim Drake becomes Batman;
    exif:WINXP.Keywords => Cool Comic Cover Dan Jurgens Key Comic 9.4 NM
    exif:WINXP.Subject => DC Back Issue Comics

    • This reply was modified 8 months, 4 weeks ago by dkifiak.
    • This reply was modified 8 months, 4 weeks ago by dkifiak.
    Plugin Author David Lingren


    Thanks for your update with the additional information; the link to the MAN page is very helpful. Thanks as well for the excerpt from the Attachment File Metadata text box.

    The MAN page helps explain why I wrote that the “xp” names are unusual. The TAG TABLES introduction on the page states:

    … A Tag ID is the computer-readable equivalent of a tag name, and is the identifier that is actually stored in the file. …

    A Tag Name is the handle by which the information is accessed in ExifTool. In some instances, more than one name may correspond to a single tag ID. In these cases, the actual name used depends on the context in which the information is found.

    Note: If you are familiar with common meta-information tag names, you may find that some ExifTool tag names are different than expected. The usual reason for this is to make the tag names more consistent across different types of meta information.

    You can see that the file only contains the Tag ID. Any tool or function that needs a human-readable name is free to invent whatever name it likes. MLA uses a standard PHP function, exif_read_data, to extract EXIF data from images. This function assigns the name “Title” to the Tag ID “0x9c9b”. You can access this value in a mapping rule as [+exif:Title+]. You can use the Attachment file Metadata text box to find the names MLA recognizes for mapping rules, etc.

    The “weird characters” in the Comments field are probably a result of an encoding issue, such as storing the value in 16-bit Unicode format. Using the WINXP equivalent is a good alternative.

    I hope that gives you what you need to complete your application. I am marking this topic resolved, but please update it if you have any problems or further questions regarding the use of EXIF metadata in MLA.

    Thread Starter dkifiak



    I tried something simple, [+exif:Title+], when I run the execute on the alt text rule no results are updated.

    Waiting: 0, Complete: 8083, Unchanged: 8083, Succeeded: 0

    EXIF/Template Value: [+exif:Title+]
    Priority: Exif
    Existing Text: Replace

    It is always something simple, sometimes its my mind

    Plugin Author David Lingren


    Thanks for the update and for posting your rule details.

    When you are simply accessing an EXIF value you don’t need to add the other parts of a substitution parameter. You can simply code:

    EXIF/Template Value: Title

    Give that a try and let me know if you still have trouble with it.

    This answer helped me wrangle a Standard field mapping Rule into shape for a new source.

    Defining the ALT Text Rule with an explicit EXIF/Template Value like template:([+xmp:description+]), template:([+xmp:title+]), or template:([+xmp:Keywords+]) works consistently. Reviewing Attachment File Metadata helps confirm available metadata of assets already in the library.

    There’s a lot of variability in available metadata for media sources and how the fields and values are referenced as @dkifiak points out again here.

    Plugin Author David Lingren


    Thanks, @stevemcnally for adding your examples to the topic. Content Templates like your are a great way to handle the cases where some but not all images have values in the fields. The parentheses around the substitution parameter mean “use the field value if it exists or ignore it if it is empty”. You can find more information in the Settings/Media Library Assistant Documentation tab.

    Thank you, David. Settings/Media Library Assistant is a gold mine. The IPTC & EXIF Processing Options make powerful combinations with **Standard field mapping Rules**. The documentation and your responsiveness in these forums is outstanding. Thank you for all of it –

    Plugin Author David Lingren


    You are most welcome. I see from your screen shots that you are running a very old version of MLA. Have you considered a more recent version?

    Many thanks, David. I’m running media-library-assistant v3.04, but have been referencing screenshots from your plugin main page on .org:

    Screenshots from mla v3.04 on WP 6.1 are in this gallery.

    The more recent Settings pages are much cleaner, but the feature/function continuity from earlier versions is impressive.

    Plugin Author David Lingren


    Thanks for your update and for starting a new topic of your own:

    Executing ‘Standard field mapping Rule’ against images in a Search result set?

    I will continue the dialog over there.

Viewing 11 replies - 1 through 11 (of 11 total)
  • You must be logged in to reply to this topic.