WordPress.org

Ready to get started?Download WordPress

Forums

NextGEN Gallery
[resolved] Plugin claims all pictures were taken on 1 January 1970 (17 posts)

  1. Tikaka
    Member
    Posted 1 year ago #

    We take pictures by several cameras and then organize them by date and time. Until now, it was ok, everything worked perfectly.

    I tried to add another album two days ago and I couldnĀ“t do it. Date next to every thumbnail is 1 January 1970, although in metainfo is the correct date and time. Now there are first all the pictures from camera 1, then all the pictures from camera 2 aso. What can I do?

    http://wordpress.org/extend/plugins/nextgen-gallery/

  2. mrskhris
    Member
    Posted 1 year ago #

    I was puzzled by this strange behaviour too. Honestly, after NextGenGallery was sold, it's not getting better.
    I did some digging and testing. Turned out, it's function get_date_time() in meta.php (wp-content/plugins/nextgen-gallery/lib/meta.php).

    This particular function tries to find image creation date by looping through several EXIF fields. It's all right and proper, but what does it do then? Calls this function on line 522 (that's approximate location, for my version of plugin):

    // Return the MySQL format
    $date_time = date( 'Y-m-d H:i:s', $date_time );

    I really wonder what kind of conversion that was meant to be. Second argument of "date" function was always epoch seconds - and here it gets "normal" Y-M-D H:M:S value. Of course it gets converted into 1970 date. No wonder.

    After I commented out that line, everything started working as it should. Hope it will save someone the frustration.

  3. mrskhris
    Member
    Posted 1 year ago #

    BTW, after that correction you can simply check all images and select "import metadata" from bulk operation dropdown. That will correct the dates.

  4. Claude Vedovini
    Member
    Posted 1 year ago #

    You're right about where there is a problem but you correction doesn't work, at the end every picture will use the upload date. Instead the get_date_time must be corrected as follow:

    $date_time = false;
    
    // get exif - data
    if ( isset( $this->exif_data['EXIF']) ) {
    
        // try to read the date / time from the exif
        foreach (array('DateTimeDigitized', 'DateTimeOriginal', 'FileDateTime') as $key) {
            if (isset($this->exif_data['EXIF'][$key])) {
                $date_time = $this->exif_data['EXIF'][$key];
            }
        }
    
        if ($date_time) $date_time = $this->exif_date2ts($date_time);
    }
    
    if (!$date_time) {
        // if no other date available, get the filetime
        $date_time = @filectime($this->image->imagePath );
    }
    
    // Return the MySQL format
    $date_time = date( 'Y-m-d H:i:s', $date_time );
    
    return $date_time;
  5. High Aspirations, Inc.
    Member
    Posted 1 year ago #

    This did not work for me. Making this change to the meta.php file and selecting the images and importing metadata resulted in the dates for the images changing to the upload date, not the date the photo was actually taken. Even deleting the images and re-uploading them changed nothing.

  6. pleasefixthis
    Member
    Posted 1 year ago #

    Strange, it worked for me - thanks Claude Vedovini!

  7. photocrati
    Member
    Plugin Author

    Posted 1 year ago #

    Hey everyone,

    We're very sorry about this bug, and want to let you know we're currently wrapping up an update to the plugin that will include a fix for this. I am going to mark this thread as resolved, I hope that's OK. We hope to have that update available sometime this week.

    Thanks!
    -Becky

  8. alfredo49
    Member
    Posted 1 year ago #

    Hi photocrati

    When this fix is implemented , should be it will be neccesary "import metadata" in the affected photos or the problem will solve alone without do nothing?

    This is because in some photos, when I import metadata I deleted all the info of the picture and I get the original info when I uploaded :-(

    Thxs

    Regards

  9. photocrati
    Member
    Plugin Author

    Posted 1 year ago #

    @alfredo49 - that may be related, I personally haven't seen that happen on my own sites. But I'll pass along your report to the developers and we'll check that out before we release v1.9.13

    Thanks!
    --Becky

  10. JohanPirlouit
    Member
    Posted 1 year ago #

    Hi photocrati,

    I currently develop a new version of my website and I try NextGen Gallery for the first time (I do really enjoy it!) and ... I also have this bug: all of my pictures are shown at 01/01/1970, wherever they come from (directly from camera, from scanner, after work in Photoshop or in Lightroom) and whatever are the metadatas, if there are some or not...

    I only keep EXIF metadatas (if there are), I don't keep IPTC or XMP.

    By the way, NextGen admin shows the right Metas (and then the right picture Date/Time) when I ask for it in any gallery list.

    I just tried Claude's fix and it works for me, both for newly uploaded picts and by re-importing metadatas for existing picts... The workaround is the expected one: EXIF Date if there is, uploaded file date if not.

    So I post here to keep track of this bug ;-)

    Regards,
    Johan

  11. donpaolo
    Member
    Posted 1 year ago #

    Any news about this bug? it's really annoying...

  12. shcshc
    Member
    Posted 1 year ago #

    I am looking forward tho the bug fix, too. :-)

  13. photocrati
    Member
    Plugin Author

    Posted 1 year ago #

    Hi everyone,

    We just pushed out the fix for this (NG 1.9.13). I apologize for the delay on the fix. We were planning to push out the fix with 2.0, but that's obviously been delayed. In retrospect, we should have just pushed this out immediately.

    For images you've already uploaded, you can go to the gallery, select images, select "Import Meta" from the drop down, and it should re-import all meta, including the correct dates.

    Please let me know if you continue to have any issues.

    Erick
    (Founder, Photocrati)

  14. alfredo49
    Member
    Posted 1 year ago #

    Hi!

    Thxs!

    It seems to works

  15. shcshc
    Member
    Posted 1 year ago #

    Hi,

    works for me, too! Thanks!

    SHC

  16. photocrati
    Member
    Plugin Author

    Posted 1 year ago #

    Thanks for letting us know.

  17. JohanPirlouit
    Member
    Posted 1 year ago #

    Hi,

    After a big bulk "Import Meta" for all galleries at once, after some new imports just to test it ..... it works!

    Thanx a lot ;-)

    Regards,
    Johan

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.