fix(android): recover missing EXIF tags and normalize across platforms#32
Merged
fix(android): recover missing EXIF tags and normalize across platforms#32
Conversation
Use file path constructor for file:// URIs instead of InputStream, giving ExifInterface seek capability. Bump exifinterface 1.3.7 → 1.4.2.
Some image editors (e.g. ON1 Photo RAW) place IFD0 tags like Make, Model, Artist, Copyright inside ExifIFD. Android's ExifInterface ignores them there. Add a lightweight fallback JPEG parser that scans the ExifIFD for these missing tags.
- ISOSpeedRatings returns number[] on Android (was string) - skip invalid Orientation 0 on Android - add BodySerialNumber tag on Android - remap iOS PixelWidth/PixelHeight to PixelXDimension/PixelYDimension - serialize arrays without brackets in Android write path
- fallback reads SHORT/LONG/RATIONAL IFD0 tags (Orientation, XResolution, YResolution, ResolutionUnit) - detect missing numeric tags with default 0 for fallback - iOS emits standard EXIF aliases alongside CGImageSource keys
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.
Summary
Fixes #31
file://URI handling: UseExifInterface(path)instead of InputStream forfile://URIs, giving ExifInterface full file access for better tag readingISOSpeedRatingsreturnsnumber[]on Android (was string), skip invalidOrientation: 0, addBodySerialNumbertagDPIWidth→XResolution,PixelWidth→PixelXDimension, etc.)androidx.exifinterfacefrom 1.3.7 to 1.4.2Type of Change
Test Plan
ISOSpeedRatingsisnumber[]on both platformsOrientation,XResolution,YResolutionpresent on AndroidBodySerialNumberpresent on AndroidISOSpeedRatingsarray input on AndroidChecklist