Skip to content

Conversation

@riccardoruspoli
Copy link
Contributor

Description

This PR refines server-side date resolution when EXIF creationDate tags are missing by also considering the client-provided asset creation timestamp, as an alternative to stats.

The topic was discussed in #21577 and #21508.

Changes:

  • server/src/services/metadata.service.ts: when EXIF creationDate tags are missing, include asset.fileCreatedAt in the fallback logic, choosing the earliest appropriate date.

How Has This Been Tested?

  • Environment: server 1.140.0 (Docker dev).
  • Unit and e2e tests.
  • Manually:
    • Photos without EXIF creation date tags → displayed with correct creation date, matching iOS Photos app.
    • Photos with full EXIF → no regression.
    • Tested single uploads, grouped uploads, and full backup.

Checklist

  • I have performed a self-review of my code
  • I have made corresponding changes to the documentation (N/A)
  • My changes generate no new warnings
  • I have not introduced unrelated changes
  • Any dependent changes have been merged and published in downstream modules (N/A)
  • I have added tests that prove my fix is effective or that my feature works (existing test suite covers this)
  • My code follows the style guidelines of this project (naming, formatting)
  • My code respects the services/repositories separation principle

@riccardoruspoli riccardoruspoli marked this pull request as ready for review September 4, 2025 16:12
@alextran1502 alextran1502 enabled auto-merge (squash) September 4, 2025 19:12
@alextran1502 alextran1502 merged commit 8747fc4 into immich-app:main Sep 4, 2025
47 checks passed
@caspinprince
Copy link

@riccardoruspoli do i need to re-upload all my iPhone photos to get these changes? is there any way to auto refresh all the dates because its difficult for me to figure out which photos were uploaded with the wrong dates

@riccardoruspoli
Copy link
Contributor Author

@caspinprince Unfortunately, yes. The fix is a combination of a mobile fix that corrects the creation date sent to the server, and this server fix that starts considering the newly sent date. You should update both the server and the iOS app, delete all the assets uploaded from the iPhone, or at least the affected ones, and then upload and extract metadata again.

@caspinprince
Copy link

@riccardoruspoli i tried your approach with a couple photos and they did not have the fixed dates. only when i upload directly from the native iOS photos app did it work. did the dates fix for you when uploaded directly from the ios immich app?

@riccardoruspoli
Copy link
Contributor Author

@caspinprince Yes, the correct workflow would be to delete the photos from Immich's server, delete them from the trash as well, then run local and remote sync on Immich's iOS app, and finally upload them again from the iOS app. Wait or trigger metadata extraction. All of this using the latest versions of both server and mobile app. I don't know if this is your case, but following these steps should fix asset dates in case the asset from iCloud doesn't have the creation date in EXIF data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants