Repository navigation
fix: treat missing exif orientation tag as unrotated - #27
Merged
Merged
Conversation
The suite only exercised the field in isolation; no test went through a real request. This adds a minimal upload view, model form and templates to the test app and four tests that render the form, submit a real multipart image, follow the redirect and assert both the rendered DOM and the database state after exif extraction and denormalization.
get_orientation raised a KeyError for files without an Orientation tag (e.g. screenshots and PNGs). ExifTool omits the tag when the image is stored unrotated, so default to a normal orientation before deciding between landscape and portrait from the pixel dimensions. Fixes #23
This was referenced Sep 12, 2026
Coverage Report for CI Build 34694220972Warning No base build found for commit Coverage: 98.276%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsRequires a base build to compare against. How to fix this → Coverage Stats
💛 - Coveralls |
Owner
Author
Two-axis review recordMethod: an independent sub-agent reviewed the four stacked diffs (this PR Findings addressed
Verified correct
|
This was referenced Sep 12, 2026
Closed
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.
Why
Fix #23.
get_orientationcrashed withKeyError: 'Orientation'for anyfile whose exif data has no orientation tag. ExifTool omits the tag when an
image is stored unrotated (common for screenshots, PNGs and processed
images), so
ExifField(denormalized_fields={'orientation': get_orientation})broke on perfectly valid files.
Walkthrough
1(normal) when the tag is missing, instead ofassuming it is present.
portrait dimensions.
Changes
exiffield/getters.pyOrientationwith a normal-orientation defaulttests/test_getters.pyOrientationtagCHANGELOG.md[Unreleased]Testing
Red first: the new test raised
KeyError: 'Orientation'before the fix(
2 failed). After:CI on
3bb0c90: run 34694220972 — 14/14 jobs success.PR breakdown
Stacked on the modernization branch
test/e2e(PR #26). Merge in order.get_datetaken