Date not being added to uploaded images in 1.6

Ben523769 Member
edited February 2023 in General support

Prior to 1.6, when I uploaded an image to an album, the Date field would be filled with the date/time of the upload. As I sorted my albums by descending date, newest images would appear at the top.

However, since updating to 1.6, when a new image is uploaded, the Date field is left blank, so new images are placed at the end of albums. I have to manually go in to each new image and set the Date field to get this to work.

I've combed through the Options menus and haven't seen anything that looks like a setting to turn this back on again. Is there something I'm missing that would auto-fill the Date field with the current date upon upload?

Thank you in advance!

Comments

  • acrylian Administrator, Developer

    Actually nothing changed here since 1.5.x. (despite some date formatting stuff that is still buggy because of some PHP 8+ changes) If you have no enabled meta date field for import, the standard date field normally reflects the file date or the discovery date.

    Please reviewe your debug log for any related errors.

  • acrylian Administrator, Developer

    Just to mention that I cannot reproduce that the date field is empty.

  • If you have no enabled meta date field for import

    Maybe this is what's missing. Do you know where this is set?

  • acrylian Administrator, Developer

    On the options. But either way there should be a date.

    Again, what does the debug log say?

  • When I upload an image, I get this warning in my debug log:

    WARNING: Cannot modify header information - headers already sent by (output started at /home/USER/mysite.com/zp-core/zp-extensions/uploader_jQuery/class-uploadhandler.php:1210) in /home/USER/mysite.com/zp-core/zp-extensions/uploader_jQuery/uploader.php on line 63

    header called from uploader.php [63]

  • acrylian Administrator, Developer

    At least a hint although I have no idea right now… We'll try to investigate it…

  • Thank you!

  • If you have no enabled meta date field for import

    Maybe this is what's missing. Do you know where this is set?

    On the options.

    On the Options - Image screen under Metadata, "Date Created" is marked Show. There's no plain "Date" available to check.

    Is there another spot in the options I should be looking?

  • acrylian Administrator, Developer

    s there another spot in the options I should be looking?

    No, that only applies to meta data. The standard date is always used as mentioned. I would suspect that you perhaps have a file/folder permission issue. Take a look here: https://www.zenphoto.org/news/permissions-for-zenphoto-files-and-folders/

  • Ben523769 Member
    edited February 2023

    I went through and set the file/folder permissions as described in that help file (0644 files/0755 directories), but it didn't fix the problem.

    I checked the debug log again and saw the same type of warnings that I posted previously. Based on the files mentioned in the warnings, I went in and changed file permissions for the files listed below from 644 to 755:
    All found in the directory/zp-core/zp-extensions/uploader_jQuery/
    class-uploadhandler.php
    class-uploadhandlerZP.php
    upload_form.php
    uploader.php

    Did a test upload, and something strange happened. It DID fill in that Date field. However, the date it filled in is December 6, 2022! The test file doesn't have that date listed as either the created, modified, or accessed date. I don't know where it pulled that from.

    So it's working better than before, but still not fixed.

  • acrylian Administrator, Developer

    Yes the permissionss do also apply to the zp-core files. It is generally a recommendation that should work but not all servers behave the same.

    Did you check the exif values of that image?

  • Ben523769 Member
    edited February 2023

    Did you check the exif values of that image?

    It's just a tiny jpg avatar image I made in Photoshop in 2010 that I grabbed for testing purposes, so it doesn't have any exif values.

    Update: I might have this fixed. I switched the graphics library in the Options - Image screen to GDlibrary and the date is being set correctly. The combination of the wrong permissions and the wrong graphics library must've been the course.

    Thank you for all your help, acrylian!!

  • I’ve been having the same issue, and it ties into a bug report I already filed-

    https://github.com/zenphoto/zenphoto/issues/1363#issuecomment-1373551637

    “The one thing I have noticed is that most of the files having the issues, though not all, are not from digital cameras; meaning screenshots, scanned images, and animated GIFs, along with video files. Things that might have different metadata than images with EXIF info from a digital camera. So maybe this makes it less of a priority, or gives you an area to focus on.”

    So like Ben523769, most of my problems with dates started with Zenphoto 1.6, on images that do not have EXIF data, and my Zenphoto is set to use Imagick instead of GDlibrary. Unfortunately, for my images, GD is not an option.

  • acrylian Administrator, Developer

    This might be related to the already mentioned date formatting issues cause by PHP 8.1+ core changes. We are on that.

  • Turns out I didn't fix it after all.

    I guess I'll just manually set dates until the next update.

  • GiehRo Member
    edited July 2023

    Hi, need to pull this up again. I just updated to Zen 1.6 including php 8.1 and ran into the same issue. Images with exif included are affected too. But I recognized two different issues - as soon as I upload from Lightroom (via Photo Upload AddIn) Images will get the date field filled - but with strange stuff - two month back or four month forward. Day ist always okay, but month and year ist always wrong. If I upload the same image via Zen Admin Interface the Date filed stays empty - which is an issue too.

    Another issue I've found relates to Archive-View (Gallery News). I've uploaded a set of images, including EXIF data. Date data has beed read correct and added to Date-Field, checked SQL DB too - also okay. But Archive-View shows the Images for month June - the actually the date is July.

  • acrylian Administrator, Developer

    This is a known bug we fixed in 1.6.1a (development build) already.

Sign In or Register to comment.