Support » Plugin: Media Library Assistant » ALL_IPCT

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

    (@dglingren)

    Thanks for your question and for the link to your test page. I was able to download the images from the test page and have a look on my own system.

    Your iptc:ALL_IPTC results, Array(), are correct; the image files do not contain any IPTC data whatsoever. Applying exif:ALL_EXIF gave a much better result; lots of EXIF metadata in the images. In particular, [+exif:Keywords+] seems to contain the information you want. You can get similar results with xmp:ALL_XMP and [+xmp:Keywords+].

    Every image processing tool makes somewhat different choices in where to store metadata, and Microsoft Photo doesn’t appear to use the IPTC structures at all.

    I am marking this topic resolved, but please update it if you have any problems or further questions regarding the above suggestions. Good luck with your application!

    David,

    As ever thanks for your reply. I have updated a new page so that it displays IPCT, EXIT and XMP info.

    It looks like the mapping from Windows PC File Property fields to exif/XMP is as follows. Using these Windows File Property settings as dummy data
    Title = CFL-title
    Subject = CFL-subject
    Tags = CFL-tags
    Authors = CFL-Authors
    Copyright = CFL-Copyright

    I have uploaded various images as shown in https://cuckoofair.co.uk/qaz. The EXIF mapping rules are set to not run on upload.

    With typical data being

    EXIF data
    array ( ‘FileName’ => ‘test-image-5-1.jpg’, ‘FileDateTime’ => 1571836938, ‘FileSize’ => 4549019, ‘FileType’ => 2, ‘MimeType’ => ‘image/jpeg’, ‘SectionsFound’ => ‘ANY_TAG, IFD0, THUMBNAIL, EXIF, GPS, INTEROP, WINXP’, ‘COMPUTED’ => ‘(ARRAY)’, […excess removed…] ‘Artist’ => ‘Downton Band’, ‘YCbCrPositioning’ => 2, ‘Copyright’ => ‘Alex Belbin’, […excess removed…] ‘Author’ => ‘D’ . “\0” . ‘o’ . “\0” . ‘w’ . “\0” . ‘n’ . “\0” . ‘t’ . “\0” . ‘o’ . “\0” . ‘n’ . “\0” . ‘ ‘ . “\0” . ‘B’ . “\0” . ‘a’ . “\0” . ‘n’ . “\0” . ‘d’ . “\0″ . ” . “\0″ . ” . “\0″ . ”, ‘Keywords’ => ‘The Borough Greens’, […excess removed…] ‘DateTimeOriginal’ => ‘2018:05:05 11:17:37’, ‘DateTimeDigitized’ => ‘2018:05:05 11:17:37’, […excess removed…] ‘UserComment’ => ‘ASCII’ . “\0″ . ” . “\0″ . ” . “\0” . ‘ ‘ . “\0″ . ” . “\0″ . ” . “\0″ . ” . “\0″ . ” . “\0″ . ” . “\0″ . ” . “\0″ . ” . “\0″ . ” . “\0″ . ” . “\0″ . ” . “\0″ . ” . “\0″ . ” . “\0″ . ” . “\0″ . ” . “\0″ . ” . “\0″ . ” . “\0″ . ” . “\0″ . ” . “\0″ . ” . “\0″ . ” . “\0″ . ” . “\0″ . ” . “\0″ . ” . “\0″ . ” . “\0″ . ” . “\0″ . ” . “\0″ . ” . “\0″ . ” . “\0″ . ” . “\0″ . ” . “\0″ . ” . “\0″ . ” . “\0″ . ” . “\0″ . ” . “\0″ . ”, […excess removed…] ‘WINXP’ => ‘(ARRAY)’, ‘CAMERA’ => ‘(ARRAY)’, ‘GPS’ => ‘(ARRAY)’, )

    XMP data –
    array ( ‘creator’ => ‘cfl-authors’, ‘rights’ => ‘cfl-copyright’, ‘subject’ => ‘CFL-tags’, ‘title’ => ‘CFL-title’, ‘description’ => ‘CFL-title’, ‘Title’ => ‘CFL-title’, ‘Author’ => ‘cfl-authors’, ‘Subject’ => ‘CFL-title’, ‘Keywords’ => ‘CFL-tags’, ‘xmlns’ => ‘(ARRAY)’, ‘dc’ => ‘(ARRAY)’, ‘MicrosoftPhoto’ => ‘(ARRAY)’, )

    With this appearing in the Edit Media – Attachment metadata of MLA:
    ‘image_meta’ =>
    array (
    ‘aperture’ => ‘0’,
    ‘credit’ => ‘cfl-authors’,
    ‘camera’ => ”,
    ‘caption’ => ‘CFL-title’,
    ‘created_timestamp’ => ‘0’,
    ‘copyright’ => ‘cfl-copyright’,
    ‘focal_length’ => ‘0’,
    ‘iso’ => ‘0’,
    ‘shutter_speed’ => ‘0’,
    ‘title’ => ‘CFL-title’,
    ‘orientation’ => ‘0’,
    ‘keywords’ =>
    array (
    ),

    Question – I was puzzled by one thing – I think I have turned off all mapping relying on manually executing the EXIF mapping rules however when I upload an image (DCF-image-11) I find that immediately after upload the details as displayed on the qaz page have been populated:

    array ( ‘FileName’ => ‘DCF-Test-Image-11.jpg’, ‘FileDateTime’ => 1571901765, ‘FileSize’ => 47224, ‘FileType’ => 2, ‘MimeType’ => ‘image/jpeg’, ‘SectionsFound’ => ‘ANY_TAG, IFD0, EXIF, WINXP’, ‘COMPUTED’ => ‘(ARRAY)’, ‘ImageDescription’ => ‘cfl-title-11’, ‘Artist’ => ‘cfl-autors-11’, ‘Copyright’ => ‘cfl-copyright-11’, ‘Exif_IFD_Pointer’ => 2240, ‘Title’ => ‘cfl-title-11’, ‘Comments’ => ‘c’ . “\0” . ‘f’ . “\0” . ‘l’ . “\0” . ‘-‘ . “\0” . ‘c’ . “\0” . ‘o’ . “\0” . ‘m’ . “\0” . ‘m’ . “\0” . ‘e’ . “\0” . ‘n’ . “\0” . ‘t’ . “\0” . ‘s’ . “\0” . ‘-‘ . “\0” . ‘1’ . “\0” . ‘1’ . “\0″ . ” . “\0″ . ” . “\0″ . ”, ‘Author’ => ‘c’ . “\0” . ‘f’ . “\0” . ‘l’ . “\0” . ‘-‘ . “\0” . ‘a’ . “\0” . ‘u’ . “\0” . ‘t’ . “\0” . ‘o’ . “\0” . ‘r’ . “\0” . ‘s’ . “\0” . ‘-‘ . “\0” . ‘1’ . “\0” . ‘1’ . “\0″ . ” . “\0″ . ” . “\0″ . ”, ‘Keywords’ => ‘cfl-tags-11’, ‘Subject’ => ‘exif mapping not run’, ‘WINXP’ => ‘(ARRAY)’, )

    array ( ‘creator’ => ‘cfl-autors-11’, ‘rights’ => ‘cfl-copyright-11’, ‘subject’ => ‘cfl-tags-11’, ‘title’ => ‘cfl-title-11’, ‘description’ => ‘cfl-title-11’, ‘Title’ => ‘cfl-title-11’, ‘Author’ => ‘cfl-autors-11’, ‘Subject’ => ‘cfl-title-11’, ‘Keywords’ => ‘cfl-tags-11’, ‘xmlns’ => ‘(ARRAY)’, ‘dc’ => ‘(ARRAY)’, ‘MicrosoftPhoto’ => ‘(ARRAY)’, )

    I created custom fields, in the ‘IPTC & EXIF Processing Options’ tab that contain the Copyright, DateTimeOriginal, Keywords (used as a location field), Artist and Title. I did this so I could more clearly see what was happening when. Note the ‘Custom Field and Attachment Metadata Processing Options’ tab is currently empty – Question is this correct as it looked like I could define the setup of Custom fields in there as well?

    Question – how do I use these custom fields in the shortcode to filter and sort the images? Eg DCF-performer = ‘New Forest School of Dance’ AND sort by DateTimeOriginal?

    Many thanks

    Paul

    By way of an update using this shortcode

    [mla_gallery columns=1 post_parent=all attachment_category='test' posts_per_page=10 mla_caption="DCF-copyright - {+custom:DCF-copyright+}<br>DCF-Copyright - {+custom:DCF-Copyright+}<br>DCF-Performer - {+custom:DCF-Performer+}<br>DCF-Title - {+custom:DCF-Title+}<br>DCF-Date-Taken - {+custom:DCF-Date-Taken+}<br>DCF-location - {+custom:DCF-location+}<br><br><br>ENDS"]

    I get this output
    https://cuckoofair.co.uk/phase-2-display-just-the-dcf-custom-fields

    Oddly adding the Code delimiters turned the output red!

    My next challenge is to get the filtering and sorting using these fields setup – so any help greatfully received.

    The basic sorting/filtering setup is as follows:
    DCF-Performer – will be the name of the band / entertainer
    DCF-Date-Taken – just needs to be a single year
    DCF-location – one of a number of fixed choices

    So I might do a sub set of images showing the ‘New Forest Dancers’ (DCF-Performer) at the ‘Maypole’ (DCF-Location) over the years sort by DCF-Date-Taken ASC or DESC.

    A future option is to create a caption along the lines of DCF-Performer+’ at the ‘+DCF-Location+(extract the Year part of DCF-Date-Taken) eg “New Forest Dancers at the Maypole (2012)”

    Many aTdHvAaNnKcSe

    Paul

    Hi in the meantime I have been playing and with some more mapping rules to standard fields
    performer / artist in description
    attachment_category to store one of the (fixed) locations
    ALT Text for the copyright statement
    and uploaded on to store the exif:DateTimeOriginal which is copied to the date field

    using this:

    [mla_gallery]
    columns=1
    post_parent=all
    attachment_category=’prncss’
    orderby=date order=DESC
    mla_caption=”Description ie DCF Performer= {+description+} | attachment category ie DCF Location = {+terms:attachment_category+} | ALT Text ie DCF copyright = {+image_alt+} | exif:DateTimeOriginal ie DCF DateTimeOriginal using date field = {+date+} || DCF-copyright – {+custom:DCF-copyright+}<br>DCF-Copyright – {+custom:DCF-Copyright+}<br>DCF-Performer – {+custom:DCF-Performer+}<br>DCF-Title – {+custom:DCF-Title+}<br>DCF-Date-Taken – {+custom:DCF-Date-Taken+}<br>DCF-location – {+custom:DCF-location+}<br><br><br>ENDS”
    post_mime_type=image/jpeg
    link=file
    [/mla_gallery]

    I now get – https://cuckoofair.co.uk/princess-only

    I am still stuck on
    1 displaying the photos for a single year…
    2 How to filter using description field?? eg use description=’Princess’ which would leave the att.category for just the location

    Oddly the <br> in the mla_caption have no effect when [mla_gallery] and [/mla_gallery] are used

    Paul

    Plugin Author David Lingren

    (@dglingren)

    Thanks for your updates and your patience in awaiting my response.

    In your first post you wrote “Question – I was puzzled by one thing – I think I have turned off all mapping relying on manually executing the EXIF mapping rules however when I upload an image (DCF-image-11) I find that immediately after upload the details as displayed on the qaz page have been populated“. When you wrote “I have turned off all mapping“, did you uncheck the “Enable IPTC/EXIF Mapping” and/or “Enable IPTC/EXIF Mapping when adding new media” boxes or did you inactivate the individual rule(s)? When you wrote “the details as displayed on the qaz page have been populated“, are you referring to fields with the exif: or xmp: prefixes or custom fields you have created from mapping rules? The exif: and xmp: prefixes go back to the image file and extract the values directly; no MLA mapping is involved. Mapping the values into custom fields adds a copy of the EXIF/XMP value to the database, which is much faster to query and display from.

    In your first post you wrote “Note the ‘Custom Field and Attachment Metadata Processing Options’ tab is currently empty – Question is this correct as it looked like I could define the setup of Custom fields in there as well?” The MLA Custom Field tab will be empty until you use the “Add New Custom Field Rule” area to define a new custom field mapping rule. The fact that custom field rules are available in the IPTC/EXIF tab as well as the Custom Field tab is deeply historical (the Custom Field tab came much later than the IPTC/EXIF tab) and I regret the confusion. The two tabs have slightly different rule elements and one or the other is better depending on your application.

    In your first post you wrote “Question – how do I use these custom fields in the shortcode to filter and sort the images? Eg DCF-performer = ‘New Forest School of Dance’ AND sort by DateTimeOriginal?

    Simple filtering by a custom field value is covered in the “Simple Custom Field Parameters” section of the Documentation tab. Sorting by a custom field value is covered in the “Order, Orderby” section. Note that you can’t sort by the original EXIF/XMP fields and values, you must copy the values to a custom field to enable this. For youe example you could code something like:

    [mla_gallery]
    post_parent=all attachment_category='prncss'
    meta_key='DCF-performer'
    meta_value='New Forest School of Dance'
    [/mla_gallery]
    

    Your recent example includes orderby=date order=DESC, which sorts on the WordPress post_date field (the date/time the file was uploaded to the Media Library). To sort on a custom field, e.g., DCF-Date-Taken you can code:

    [mla_gallery]
    post_parent=all attachment_category='prncss'
    meta_key="DCF-Date-Taken"
    orderby=meta_value
    order=DESC
    [/mla_gallery]
    

    Sadly, both of these simple examples use meta_key and there’s no way to specify filtering and sorting on different custom fields. To implement your example you can use the more powerful meta_query parameter for the filtering:

    [mla_gallery]
    post_parent=all attachment_category='prncss'
    meta_key="DCF-Date-Taken"
    orderby=meta_value
    order=DESC
    meta_query="array( array( 'key' => 'DCF-performer', 'value' => 'New Forest School of Dance', 'compare' => 'EQUAL' ) )"
    [/mla_gallery]
    

    You can find another example of the meta_query in my latest response to your related topic:

    End to end Processing of photos

    That topic also addresses your single-year filtering question. Filtering by the WordPress Description field is possible with the “Keyword(s) Search” parameters, as described in the Documentation tab.

    Finally, you wrote “Oddly the <br> in the mla_caption have no effect when [mla_gallery] and [/mla_gallery] are used“. Yes, that’s a consequence of the way WordPress handles some HTML markup in the content of an “enclosing shortcode”. You can try moving the mla_caption parameter into the first part of the shortcode, i.e.:

    [mla_gallery mla_caption="Description ie DCF Performer= {+description+} | attachment category ie DCF Location = {+terms:attachment_category+} | ALT Text ie DCF copyright = {+image_alt+} | exif:DateTimeOriginal ie DCF DateTimeOriginal using date field = {+date+} || DCF-copyright – {+custom:DCF-copyright+}<br>DCF-Copyright – {+custom:DCF-Copyright+}<br>DCF-Performer – {+custom:DCF-Performer+}<br>DCF-Title – {+custom:DCF-Title+}<br>DCF-Date-Taken – {+custom:DCF-Date-Taken+}<br>DCF-location – {+custom:DCF-location+}<br><br><br>ENDS"]
    columns=1
    post_parent=all
    attachment_category='prncss'
    orderby=date order=DESC
    post_mime_type=image/jpeg
    link=file
    [/mla_gallery]
    

    You can mix parameter location within the brackets and within the content area in any combination that makes sense.

    I hope the above suggestions are helpful. Let me know if you have problems or further questions.

    PS – I am in California and we are about to lose power for a few days, so there may be a delay in my next response.

    cuckoofairweb

    (@cuckoofairweb)

    David,

    Thanks for the as ever comprehensive replies and also bearing with me as I re-learn programming skills. (Not used since my Digital Signal Processing days in the mid 80’s!)

    I think I’ll collate all your advice into a single word doc along with other gems from the support forum and have a read.

    One thing I have done is to extract just the year from the DateTimeOriginal and place it into a Custom Field (or should I use Att.Tags?). This’ll make filtering easier – for sorting I’ll use the DateTimeOriginal field.

    Is it better to use Custom Fields (eg DCF-Performer/DCF-Location/DCF-Year) OR the WP standard fields eg Attachment Category/Attachment Category/Attachment Tag respectively.

    I reckon this will get me a custom title:
    template:([+exif:Artist+’ performing at ‘+exif:Keywords+\\(+exif:DateTimeOriginal,date(‘Y’)\\)+]) thou I hope I have added the right escape characters?

    Hope you are not to impacted by the situation in Calfornia.

    Plugin Author David Lingren

    (@dglingren)

    Thanks for working through the replies and earlier topics. I hope you are finding the programming skills return quickly and are a source of satisfaction.

    Regarding your custom fields Vs taxonomies question, I feel the decision to use taxonomies rests on the values you expect to see in your application. Taxonomies are useful to divide your items into groups that share a common characteristic, e.g., “animal, mineral, vegetable” categories and perhaps “animal/land, animal/air, animal/water” subcategories. Tags are less formal, non-hierarchical labels/groups. The point is that a taxonomy will have a reasonable number of terms and a given term (category/tag) is expected to have multiple items assigned to it. Custom fields are better for one-off values such as a name or an address or a date.

    You wrote “I reckon this will get me a custom title“. It looks like you are missing a bracket in the \\(+exif:DateTimeOriginal portion (try \\([+exif:DateTimeOriginal but the rest looks good. If it doesn’t work, let me know and I can investigate further.

    Our power was out for 40 hours and the smoke makes the air quality “unhealthy” but we are otherwise unaffected for now. Overall, it’s a bad situation.

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