Support » Plugin: Media Library Assistant » Map IPTC/EXIF Metadata

  • Resolved christophknoth

    (@christophknoth)


    Hi David,

    I am getting more and more familiar with your plugin nice work!

    I am trying to use it as a starting point to create a map with a lot of pictures on it. So I used your example in your documentation and added meta:image_meta.latitude and meta:image_meta.longitude which works when I click on “Map IPTC/EXIF Metadata” in the backend next to the image or if I use the “Map All Attachments” button in the “IPTC & EXIF Processing Options”. But it does not fill the fields on upload even though it works for the standard fields like the captions. “Enable IPTC/EXIF Mapping when adding new media” is ticked on.

    Any idea what could cause this?

    Greetings
    Christoph

    the Attachment Metadate after upload:

    ...
        'caption' => 'test',
        'created_timestamp' => false,
        'copyright' => '',
        'focal_length' => '661.9797979798',
        'iso' => '70',
        'shutter_speed' => '1/0',
        'title' => '',
      ),
    )

    after the click on the button Map IPTC/EXIF Metadata (Map Custom Field Metadata does not do anything)

    ...
        'caption' => 'test',
        'created_timestamp' => false,
        'copyright' => '',
        'focal_length' => '661.9797979798',
        'iso' => '70',
        'shutter_speed' => '1/0',
        'title' => '',
        'latitude' => '51 33.6453N',
        'longitude' => '11 22.4729E',
      ),
    )

    http://wordpress.org/plugins/media-library-assistant/

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

    (@dglingren)

    Christoph,

    Thanks you for the kind words and for bringing this issue to my attention. The current version does not update Attachment Metadata automatically when a new image is uploaded to the Media Library. You have found a bug, which I will fix in my next version.

    I will leave this item unresolved until I release the next version. Thanks again for reporting this and for your interest in the plugin.

    Thread Starter christophknoth

    (@christophknoth)

    Thank you!

    And another thing I found. You save the coordinates with ESWN attached to the numbers. For map plugins like leaflet it is more handy to just have pure numbers.

    e.g.
    N40.446195 W79.982195 =>
    40.446195,-79.982195

    So I added a Number only version before DD is finally attached to $ref

    $flip = ($ref == 'W' or $ref == 'S') ? -1 : 1;
    $gps_data['LatitudeDN'] = $flip * $gps_data['LatitudeDD'];
    $gps_data['LongitudeDN'] = $flip * $gps_data['LongitudeDD'];
    Thread Starter christophknoth

    (@christophknoth)

    What I also just noticed. I am also using a plugin called Force Regenerate Thumbnails to recreate all the images in a different size (I do this often while designing and developing to find a good size). When I do this I am losing all mla custom field data (not the caption and title date) and have to repress the mla Custom field mapping-button which brings back all the extra exif data like in my case the gps data.

    I guess it could be related to the first issue.

    Plugin Author David Lingren

    (@dglingren)

    Thanks for both of your updates. With regard to your GPS coordinates comment, have another look at the “LatitudeSDD” and “LongitudeSDD” values. It looks like these give you the signed values you want without the additional code. Am I missing something?

    With regard to the Force Regenerate Thumbnails issue, thanks for the link and the observation. Your comments have led me to consider a new feature for my next version.

    Right now, MLA will only process its IPTC/EXIF and Custom Field mapping rules when an attachment is first uploaded (that’s what the “Enable … Mapping when adding new media” checkboxes promise). There are a number of plugins that regenerate the metadata at a later time, and at present the MLA mapping rules not re-run when that occurs. Unless I find some negative side-effect I will probably add new “Enable … Mapping when updating media metadata” options to the next version.

    Of course, this will not fix the problems caused by image-editing plugins and code that discards the IPTC/EXIF metadata after altering the image file.

    Thanks for motivating another enhancement.

    Thread Starter christophknoth

    (@christophknoth)

    If I am not wrong LatitudeSDD does this:
    $gps_data[‘LatitudeSDD’] = $refs . $gps_data[‘LatitudeDD’];

    so it will look like this: W79.982195
    but I need a number like so: -79.982195

    PS: Because of all your help I gave a donation to your project.

    Plugin Author David Lingren

    (@dglingren)

    First of all, thank you so much for your donation to our work; it is a real motivator to continue supporting and enhancing the plugin!

    If you look a bit earlier in the source code you will see:

    $gps_data['LatitudeRefS'] = ( 'N' == $exif_data['GPSLatitudeRef'] ) ? '' : '-';
    $ref = $gps_data['LatitudeRef'];
    $refs = $gps_data['LatitudeRefS'];

    So $refs should be empty for North or a minus (‘-‘) for South. I think that’s what you want, right? Give it a try and let me know if there’s a problem.

    Thread Starter christophknoth

    (@christophknoth)

    Oh, I miss read that. Tried it and it works!

    Plugin Author David Lingren

    (@dglingren)

    I have released version 1.70, which fixes the bug you identified regarding attachment metadata updates during uploading. I also added new Settings/Media Library Assistant IPTC/EXIF and Custom Field settings so you can automatically re-map attachment metadata when other code or plugins update it.

    I am marking this issue resolved, but please let me know if you have any further trouble after updating to the new release.

    Again, thanks for identifying the bug and for your interest in the plugin.

    Thread Starter christophknoth

    (@christophknoth)

    In finally had a reason to try it, when I had to regenerated all the images on the site. And after enabling the function you implemented it worked flawlessly. Thank you.

    Plugin Author David Lingren

    (@dglingren)

    Thanks for your update with the good news; it’s always great to hear that things are working!

    If there’s anything else I can do, let me know.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Map IPTC/EXIF Metadata’ is closed to new replies.