• Welcome to the Chevereto User Community!

    Here, users from all over the world come together to learn, share, and collaborate on everything related to Chevereto. It's a place to exchange ideas, ask questions, and help improve the software.

    Please keep in mind:

    • This community is user-driven. Always be polite and respectful to others.
    • Support development by purchasing a Chevereto license, which also gives you priority support.
    • Go further by joining the Community Subscription for even faster response times and to help sustain this space
  • Chevereto Support CLST

    Support response

    Support checklist

    • Got a Something went wrong message? Read this guide and provide the actual error. Do not skip this.
    • Confirm that the server meets the System Requirements
    • Check for any available Hotfix - your issue could be already reported/fixed
    • Read documentation - It will be required to Debug and understand Errors for a faster support response

Can I effectively change the image dates for more accurate sorting?

goldtom

Chevereto Member
🎯Description of the issue

Apologies for long-winded background info, hopefully it helps for context. I am running a single personal website on v3.15.1 with a MySQL DB for which I uploaded many old albums into external S3 storage using the bulk uploader and SFTP. I'm finding that a lot of those old photos (from 1999 onwards) don't have the best file metadata or image exif data, and I'm trying to clean that up. For example, the image_date field looks like it pulls from the file's created date. Which is probably fine most of the time. But in this case, that date is May 15, 2020, since that must be when I copied a bunch of these files locally from various external hard drives, before uploading them to my Chevereto instance. The files' updated date is closer (probably when I must have transferred them off the camera or otherwise edited the photos 20 years ago), but many of them also have the desired date still in the image exif data (e.g., in the DateTime or FileDateTime JSON keys. I recognize that the exif data is going to be different for different cameras and isn't all that reliable, so I don't expect the chev software to behave differently in this regard.

As a result of Chevereto's use of the file's creation date, though, I get a lot of undesired effects when it comes to things like sorting by Most Recent/Oldest or even just the "cover photo" for each album (which is the first image, based on whichever file happened to be written first when I copied them from another hard drive). I thought I could get clever with a SQL query to replace the image_date and image_date_gmt values with the preferred values from the exifdata field, but that's when I discovered the roadblock: under the datefolders configuration, the image URLs are dynamically generated at runtime based on the image_date field, regardless of where the image was originally saved in storage. So, after updating the database with the new, correct dates, my instance will lose its connection to the affected images, since it's now looking for them in the wrong location.

Which brings me to my question: Can you think of any sort of solution to this problem? Is there any way for me to properly update the image_date field for each of these photos while still preserving the chevereto connection to those photos in their original storage location (i.e., make everything continue to work, I don't care about file URL, but just display the new image date and use it for sorting)?
  • Can I utilize the image_path field (which is currently NULL for these items) and just generate the correct S3 path using the existing image_date values before updating them?
  • If I switch the storage config from datefolders to direct, that won't help me for all of these existing photos, will it?
  • I can't use the bulk upload tool to only update metadata, right? And anyway, that probably wouldn't help me because of the dynamic datefolder path problem; I'd also have to change the corresponding location of each file on S3, and that's just going to be beyond my capabilities and probably will introduce risk of something else breaking unintentionally.
  • Is my only solution to delete all of the old albums, figure out a way to extract the dates I want from the image files' exif data, and then generate a proper metadata file to go with them when I re-upload? Obviously that's the last resort; I've got about 10,000 files uploaded so far, and uploading (or rather, processing) takes a while with my current server hardware setup.
Anyway, that's what I've got. I do like the software, and I'm looking forward to the additional flexibility and extensibility of v4. But yeah, I clearly got ahead of myself by uploading all of these files without assessing and cleaning up metadata locally beforehand. But I figured I'd ask if you have any ideas. Thanks!


▶🚶‍Reproduction steps
  1. Upload lots of old photos for which the file created date is recent and does not match the actual date photo was taken (which is available in exifdata).
  2. Bang head against desk upon realization that I'm stuck with a bunch of photos that, upon uploading, are organized much more poorly on chevereto than I had expected.
  3. Try to update the database by pulling image dates from exif data and replacing image_date in chv_images.
  4. Load albums and images, only to discover that image paths (thumbnails, images, download paths, etc.) are all dynamic at runtime, based on the image date, not the location where those files were originally created in storage on upload.
😢Unexpected result

Chevereto uses the file date created as the image_date rather than the image's exifdata dates (when available), which means my date-based sorting is wonky.


📃Error log message
 
Eh, I'm realizing that I'm probably further away from a solution than I think with this. I believe the image_date field isn't even the "date created" property from the uploaded file, but rather the date the file was uploaded to chevereto. So I can't even solve it if I were to generate metadata JSON files and re-upload everything, right? Like, I can't force the image_date field successfully regardless of what I do, without breaking something else.

Hmmm. I guess my question remains: any ideas to get me where I'm trying to be with this? That is, be able to define and then sort images by some date from the exifdata rather than the upload date? I guess this is turning into more of a feature request, and I can imagine it's a bit of a rabbit hole to figure out which exif field to use as the date, especially since it could be different for each camera, each upload, etc. But it would be great nonetheless.
 
Dates in images table are for when the file got uploaded, not when it was created.

Can I utilize the image_path field (which is currently NULL for these items) and just generate the correct S3 path using the existing image_date values before updating them?
No, that field is used due to legacy issues with the previous major version.

If I switch the storage config from datefolders to direct, that won't help me for all of these existing photos, will it?
Switching methods only affects future uploads.

I can't use the bulk upload tool to only update metadata, right?
No, images don't have metadata on Chevereto. We just store the raw exif contents.

Is my only solution to delete all of the old albums, figure out a way to extract the dates I want from the image files' exif data, and then generate a proper metadata file to go with them when I re-upload?
To be honest, you brought so many issues and information that I don't know what is the actual issue in the first place.

The images are just mapped in Chevereto, you can do all the mappings you want and long as the paths reflect the database the images will be showing. Sorry but there's no way to make it work with photo taken date, you have to manually workaround that.
 
Back
Top