Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Photo crash] Don't attempt to rotate the image if orientation is undefined in exif metadata #2694

Merged
merged 4 commits into from
Aug 27, 2024

Conversation

shobhitagarwal1612
Copy link
Member

@shobhitagarwal1612 shobhitagarwal1612 commented Aug 24, 2024

Fixes #2688

From the error stacktrace, we can identify that the crash happened as we haven't handled ExifInterface.ORIENTATION_UNDEFINED when attempting to force rotate an image.

As per https://stackoverflow.com/a/28024859, some devices don't write the device's orientation to the EXIF metadata and directly rotate the image pixels.

So, this PR proposes to ignore the rotating if this is unset.

@sufyanAbbasi @gino-m PTAL?

Copy link

codecov bot commented Aug 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 61.02%. Comparing base (d7d18dd) to head (68c71ac).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##             master    #2694   +/-   ##
=========================================
  Coverage     61.02%   61.02%           
  Complexity     1162     1162           
=========================================
  Files           263      263           
  Lines          6050     6050           
  Branches        827      827           
=========================================
  Hits           3692     3692           
  Misses         1890     1890           
  Partials        468      468           
Flag Coverage Δ
service 61.02% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
...i/datacollection/tasks/photo/PhotoTaskViewModel.kt 23.07% <ø> (ø)

Copy link
Collaborator

@gino-m gino-m left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix!

@gino-m gino-m merged commit 29ae796 into master Aug 27, 2024
4 checks passed
@gino-m gino-m deleted the ashobhit/2688/orientation-bug branch August 27, 2024 17:58
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.

[Photo task] App crashes after taking photo on Pixel 3 API 28 emu
2 participants