memories: reject implausible filename-derived timestamps #80

Merged
cameron merged 1 commits from feature/filename-date-plausibility into master 2026-05-07 16:02:52 +00:00
Owner

Filenames like 000227580005.jpg (film-scan ID) and
IMG_21323906751390.jpeg were matched by the 10-16 digit timestamp
regex and resolved to 1970 / 2037, then written into
image_exif.date_taken with source = 'filename'. EXIF-less
photos showed up under those bogus dates everywhere date_taken is
read.

Two new guards in extract_date_from_filename:

  • leading zero → reject (real epoch values don't have one at any
    sane resolution).
  • resolved year outside [1995, now+1y] → reject.

Both let the date_resolver waterfall fall through to fs_time,
which is a much better proxy for content age than a fake epoch
date. Regression tests cover the two reported filenames.

Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com

Filenames like `000227580005.jpg` (film-scan ID) and `IMG_21323906751390.jpeg` were matched by the 10-16 digit timestamp regex and resolved to 1970 / 2037, then written into `image_exif.date_taken` with `source = 'filename'`. EXIF-less photos showed up under those bogus dates everywhere date_taken is read. Two new guards in `extract_date_from_filename`: - leading zero → reject (real epoch values don't have one at any sane resolution). - resolved year outside [1995, now+1y] → reject. Both let the date_resolver waterfall fall through to fs_time, which is a much better proxy for content age than a fake epoch date. Regression tests cover the two reported filenames. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
cameron added 1 commit 2026-05-07 16:02:43 +00:00
Filenames like `000227580005.jpg` (film-scan ID) and
`IMG_21323906751390.jpeg` were matched by the 10-16 digit timestamp
regex and resolved to 1970 / 2037, then written into
`image_exif.date_taken` with `source = 'filename'`. EXIF-less
photos showed up under those bogus dates everywhere date_taken is
read.

Two new guards in `extract_date_from_filename`:
- leading zero → reject (real epoch values don't have one at any
  sane resolution).
- resolved year outside [1995, now+1y] → reject.

Both let the date_resolver waterfall fall through to fs_time,
which is a much better proxy for content age than a fake epoch
date. Regression tests cover the two reported filenames.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
cameron merged commit e55f6a5961 into master 2026-05-07 16:02:52 +00:00
cameron deleted branch feature/filename-date-plausibility 2026-05-07 16:02:52 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Apps/ImageApi#80