BUG: Takeout photos keep the wrong date if their JSON file arrives after the photo
Is there an existing issue for this?
- [x] I have searched the existing issues
What happened?
Steps to reproduce
- Add an empty folder to PictoPy.
- Copy in a photo with no EXIF date. It shows up under the date it was copied, which is fine for now.
- Copy in its
IMG_0001.jpg.supplemental-metadata.jsonwith a differentphotoTakenTimeandgeoData - Wait for the sync. The date and location don't change.
If both files are already in the folder when you add it, the date and location are read correctly. So the JSON is fine, and only the order matters.Since #1481, rescans skip a photo if its size and modified time haven't changed (image_util_is_unchanged() in backend/app/utils/images.py). Adding the JSON doesn't change the photo, so it's skipped and the JSON is never read. Videos have the same check. A possible fix is to not skip files whose date came from the file system (date_source == "filesystem"), or to also check whether the JSON is newer.
Record
- [x] I agree to follow this project's Code of Conduct
👋 Thanks for opening this issue! The maintainers will review it shortly. Till then, do not open any PR. This is a strict rule we like to follow around here :)
⚠️ Potential Duplicate Issue (Semantic Match)
This issue appears semantically similar to the following issues in AOSSIE-Org/PictoPy:
-
BUG:Google Takeout photos with duplicate or long names lose their date and location (#1684, open) https://github.com/AOSSIE-Org/PictoPy/issues/1684 Similarity: 73.3%
-
BUG: iPhone/mobile images (.heic, .heif, .avif) are silently skipped and unsupported during folder import (#1576, open) https://github.com/AOSSIE-Org/PictoPy/issues/1576 Similarity: 57.3%
-
BUG: Photos larger than ~179 megapixels are silently skipped during import (#1633, closed) https://github.com/AOSSIE-Org/PictoPy/issues/1633 Similarity: 56.2%
Please review before proceeding.
This isn't a duplicate of #1684. That one is about the JSON file not being found because of its name . Here the JSON has the normal name and is found fine on a fresh scan. The problem is timing, if the JSON shows up after the photo was already indexed, the rescan skips the photo as unchanged since #1481 so the JSON is never read.
@rohan-pandeyy can i get assigned on this issue if no one is assigned yet?
@rohan-pandeyy @ManyaJain111 can i get assigned on this issue if no one is assigned yet?
Hi @rohan-pandeyy, I'd like to fix this. My plan is to not skip files on rescan if their date came from the filesystem or their JSON is newer than the photo. Does that sound ok? Could you review this once you get a chance?