Repository navigation
Keep EXIF exposure settings, GPS altitude and GPS time at index time - #445
Merged
Merged
Conversation
…437) Pillow returns FNumber, ExposureTime, FocalLength and GPSAltitude as IFDRational and GPSTimeStamp as a tuple; the extractor's type filter dropped all of them, so the drawer's Exposure row showed only ISO. - Convert rationals to finite floats; zero denominators (NaN) are dropped so the stored record stays JSON-safe. - Store GPSTimeStamp as HH:MM:SS; negate GPSAltitude when GPSAltitudeRef says below sea level. - Formatter: show shutter speeds as 1/N only when that is accurate (0.8 s no longer reads "1/1s"), never divide by zero, round long rational f-numbers and focal lengths. Existing albums need an Update or Rebuild Index to pick up the values. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
IFD1 describes the embedded thumbnail and reuses the main image's tag numbers, so flattening it into the metadata dict let the thumbnail's Orientation, ImageWidth/ImageLength and XResolution overwrite the photo's, and added thumbnail housekeeping keys (JpegIFOffset, Compression) to the record. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #437.
Pillow hands back
FNumber,ExposureTime,FocalLengthandGPSAltitudeasIFDRational, andGPSTimeStampas a tuple. The EXIF extractor kept onlystr/int/float/bool, so these were dropped at index time. For a typical camera photo, the drawer's Exposure row showed onlyISO N, and altitude and GPS time never appeared.Extraction (
metadata_extraction.py)json.dumpswrites as invalid JSON, so it is dropped.GPSTimeStampis stored asHH:MM:SS(UTC). An out-of-range or unreadable timestamp is dropped.GPSAltitudeis negative whenGPSAltitudeRefsays below sea level.Orientation,ImageWidth/ImageLengthand resolution, and it added thumbnail housekeeping keys (JpegIFOffset,Compression) to the record.Formatting (
exif_formatter.py)1/Nonly when that is accurate: 0.8 s →0.8s(was1/1s), 1/600 →1/600s. A zero exposure no longer crashes.5.4mm, not5.40625mm.Note: metadata is captured at index time, so existing albums need an Update or Rebuild Index to show the new values.
Tests: new extraction tests round-trip real JPEGs through Pillow, and new formatter tests cover the rendered rows. The full backend suite passes (1390 tests).
Known issues this PR does not touch: MakerNote and UserComment are stored as long junk strings (now raw GPS byte fields like
GPSAltitudeReftoo, visible only in the{ }JSON view).🤖 Generated with Claude Code