Skip to content

fix(android): recover missing EXIF tags and normalize across platforms#32

Merged
lodev09 merged 4 commits intomainfrom
fix/android-missing-exif-tags
Feb 22, 2026
Merged

fix(android): recover missing EXIF tags and normalize across platforms#32
lodev09 merged 4 commits intomainfrom
fix/android-missing-exif-tags

Conversation

@lodev09
Copy link
Owner

@lodev09 lodev09 commented Feb 22, 2026

Summary

Fixes #31

  • Android file:// URI handling: Use ExifInterface(path) instead of InputStream for file:// URIs, giving ExifInterface full file access for better tag reading
  • IFD0 fallback parser: Raw EXIF parser that recovers IFD0 tags (Make, Model, Artist, Copyright, Orientation, XResolution, YResolution, etc.) when image editors misplace them in ExifIFD — supports STRING, SHORT, LONG, and RATIONAL formats
  • Tag normalization: ISOSpeedRatings returns number[] on Android (was string), skip invalid Orientation: 0, add BodySerialNumber tag
  • iOS aliases: Emit standard EXIF names alongside CGImageSource keys (DPIWidthXResolution, PixelWidthPixelXDimension, etc.)
  • Bump androidx.exifinterface from 1.3.7 to 1.4.2

Type of Change

  • Bug fix

Test Plan

  • Read EXIF from the same image on both iOS and Android
  • Verify ISOSpeedRatings is number[] on both platforms
  • Verify Orientation, XResolution, YResolution present on Android
  • Verify BodySerialNumber present on Android
  • Verify iOS returns both original and standard tag names
  • Test write with ISOSpeedRatings array input on Android

Checklist

  • I tested on iOS
  • I tested on Android
  • I updated the documentation (if needed)

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
@lodev09 lodev09 merged commit 2fc52b0 into main Feb 22, 2026
3 checks passed
@lodev09 lodev09 deleted the fix/android-missing-exif-tags branch February 22, 2026 17:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Different exif being read between Android and iOS (missing data on Android)

1 participant