Support » Plugin: Media Library Assistant » Order by EXIF Date+Time

  • Resolved meggsico

    (@meggsico)


    Hello David

    I create galleries by attachment-categories. The problem is the images are not well sorted. Is it possible that i order the images by the exif date + time stamp? I’m sure that your great plugin can do this :-). Can you help me please.

    What I am still interested in is, how can I sort the pictures as I like. I studied the documentation but I couldn’t find what I was looking for.

    I have one more question about the thumbnails. Is it possible that Video files get a thumbnail which i uploaded to a gallery? Now i see only an icon for the file extension. Maybe i can set a frame from the video for a thumbnail.

    Thx again for your excellent support.

    Meggs

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

    (@dglingren)

    Thanks for your question. You can order the images as you want by defining a custom field containing the EXIF date+time and then sorting the [mla_gallery] by the custom field.

    To create the custom field, the steps are:

    • Navigate to the Settings/Media Library Assistant “Custom Fields” tab.
    • Make sure the “Enable custom field mapping when adding new media” box is checked. If not, check the box and click “Save Changes”.
    • Scroll down to the “Add New Custom Field Rule” area below the “Enable” checkboxes.
    • Under the “Name” dropdown control, click “Enter new field” to create a new custom field.
    • In the “Name” text box, give your field a name, e.g., “Date Taken”.
    • From the Data Source dropdown list, select “- Template (see below) -”.
    • In the “Meta/Template” text box, enter [+exif:DateTimeOriginal+]. You can also try “DateTime” or “DateTimeDigitized”; these are the most likely EXIF field names.
    • Click the “MLA Column” check box if you want to make the field available in the Media/Assistant submenu table. You can also click the “Quick Edit” and “Bulk Edit” check boxes to make the field available in the Media/Assistant submenu table Quick Edit and Bulk Edit areas if that’s useful for you.
    • In the “Existing Text” dropdown list, select “Replace”.
    • In the “Format” dropdown list, select “Native”.
    • In the “Option:” dropdown list, select “Text”.
    • Click the “Delete NULL Values” checkbox.
    • Leave the “Status” set to “Active” so the rule will be executed for future additions to the Media Library.
    • Click the “Add Rule” button to save your work.

    Once the rule is created you must execute it to create the “Date Taken” value for the items already in your Media Library:

    • Find the “Date Taken” (or your chosen field name) in the table of rules on the right-hand side of the screen. If you don’t see your new rule, type the name you gave it in the search box above the table and click “Search Rules”.
    • Hover your mouse in the “Name” column and click the “Execute” rollover action.
    • Wait for the mapping process to complete.

    If you don’t see the “Date Taken” column in the Media/Assistant submenu table pull down the “Screen Options” area and make sure that “Date Taken” is listed and the box next to it is checked.

    Once the custom field is present you can sort on it by adding some parameters to your shortcode:

    meta_key="Date Taken" orderby=meta_value order=”DESC”
    

    You asked “ Is it possible that Video files get a thumbnail which i uploaded to a gallery? MLA adds “Featured Image” support for Media Library items. First, add the image you want to use as your thumbnail to the Media Library. Navigate to the full-screen “Edit Media” page for an item and scroll down to the “Featured Image” box on the right-hand side and assign the image you want, the click “Update”.

    The image will not be displayed in the Media/Assistant admin submenu but it will appear in the gallery display generated by the [mla_gallery] shortcode.

    I hope the above suggestions get you the results you seek. I am marking this topic resolved, but please update it if you have problems or further questions about the solutions I outlined. Thanks for your continued interest in the plugin.

    Thread Starter meggsico

    (@meggsico)

    Hello David

    It works. Great!!!

    Thank you very much.

    Meggs

    Thread Starter meggsico

    (@meggsico)

    Hello David

    For *.mp4 files it doesn’t work. I can’t extract Date+time with an custom field. But the tested mp4-File has got these values. So I guess, your code can extract these values only for images. Is this correct? For images it works perfect.

    I attached a screenshot of the meta-data and a video. Maybe you have time to test it.

    screenshot

    file

    Something more. You show me a solution to connect thumbnails with videos. Is this the only way. I ask because it is a bit cumbersome to upload a image and connect it to the video-file. It would be pretty cool, if your code can take the first frame automatically from the video-file. I manage my files on my PC and my software automatically displays thumbnails of my videos. See the attached file.

    Thank you for your response

    Meggs

    Plugin Author David Lingren

    (@dglingren)

    Thanks for your updates and the good news about your progress.

    The IPTC and EXIF standards apply to “image” MIME types. For audio and video MIME types there is a different standard, ID3. MLA provides an id: prefix to access this information; you can find more information in the “Field-level prefix values” section of the Settings/Media Library Assistant Documentation tab.

    The video file you posted a link to has quite a lot of ID3 metadata embedded in it. In particular, the “quicktime” element has about 3 kilobytes of data in a complex format. I was able to find an sub element that seems to have what you are looking for. You can access the value this way:

    [+id3:quicktime.moov.subatoms.0.creation_time_unix,timestamp('Y:m:d H:i:s')+]
    

    The value I found in your file is “2020:07:29 07:34:09″, two hours earlier than your screen shot but probably fine for gallery sorting purposes.

    You can change your mapping rule to work for both image and video files. In the “Meta/Template” text box, enter”

    ([+exif:DateTimeOriginal+]|[+id3:quicktime.moov.subatoms.0.creation_time_unix,timestamp('Y:m:d H:i:s')+])
    

    The above template will use the DateTimeOriginal field, if present, or the creation_time_unix field as a second alternative. If neither value is present the result will be empty.

    You asked “You show me a solution to connect thumbnails with videos. Is this the only way.” I regret the short answer is yes, that is the only way. WordPress, as far as I know, does not include software that can extract frames from video files. The “Featured Image” solution was the best I could manage with the time and knowledge I had available.

    Thread Starter meggsico

    (@meggsico)

    Hello David

    It works You’re amazing :-).
    Thank you for your time and enjoy your vacation.

    cheers,
    Meggs

    Plugin Author David Lingren

    (@dglingren)

    I took the opportunity to enhance the Media/Assistant submenu table to display the Featured Image, when present for a non-image item, as the item thumbnail.

    I have uploaded a new MLA Development Version dated 20200810 that includes the enhancement. You can find step-by-step instructions for using the Development Version in this earlier topic:

    PHP Warning on media upload with Polylang

    Once the Development Version is installed you should see the thumbnail image in the table instead of, for example, the generic “video” icon.

    It would be great if you could install the Development Version and let me know if it works for you. Thanks for inspiring this MLA improvement.

    Thread Starter meggsico

    (@meggsico)

    Hi David

    I installed the development Version. It works. Thank you for this new cool feature.

    Meggs

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Order by EXIF Date+Time’ is closed to new replies.