Skip to content

fix(android): correct EXIF orientation for non-JPEG camera captures - #976

Open
GitToTheHub wants to merge 1 commit into
masterfrom
pr-fix-android-correctOrientation-for-PNG
Open

fix(android): correct EXIF orientation for non-JPEG camera captures#976
GitToTheHub wants to merge 1 commit into
masterfrom
pr-fix-android-correctOrientation-for-PNG

Conversation

@GitToTheHub

Copy link
Copy Markdown
Contributor

Platforms affected

Android

Motivation and Context

  • MediaStore.ACTION_IMAGE_CAPTURE always writes JPEG data into the capture file, regardless of the requested encodingType/file extension. Deriving the source mimeType from that file's extension (via FileHelper.getMimeType) caused PNG-named captures to be misreported as image/png, so getScaledAndRotatedBitmap() skipped reading the EXIF orientation and correctOrientation had no effect.
  • Use the actual JPEG mimeType for the captured source data instead, so orientation correction works regardless of the requested encodingType.
  • Fixes correctOrientation: true is ignored for encodingType: PNG #974

Generated-By: Claude Sonnet 5

Description

Testing

Checklist

  • I've run the tests to see all new and existing tests pass
  • I added automated test coverage as appropriate for this change
  • Commit is prefixed with (platform) if this change only applies to one platform (e.g. (android))
  • If this Pull Request resolves an issue, I linked to the issue in the text above (and used the correct keyword to close issues using keywords)
  • I've updated the documentation if necessary

- `MediaStore.ACTION_IMAGE_CAPTURE` always writes JPEG data into the capture file, regardless of the requested encodingType/file extension. Deriving the source mimeType from that file's extension
(via `FileHelper.getMimeType`) caused PNG-named captures to be misreported as image/png, so `getScaledAndRotatedBitmap()` skipped reading the EXIF orientation and `correctOrientation` had no effect.
- Use the actual JPEG mimeType for the captured source data instead, so orientation correction works regardless of the requested encodingType.

Generated-By: Claude Sonnet 5
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.

correctOrientation: true is ignored for encodingType: PNG

1 participant