RedApparat / Fotoapparat

Making Camera for Android more friendly. 📸
Apache License 2.0
3.82k stars 406 forks source link

Use device orientation instead of system orientation for image rotation calculations #90

Closed raedur closed 6 years ago

raedur commented 7 years ago

Previously the image rotation was being calculated from the system orientation, which meant if a device was locked into portrait and the device was rotated landscape (i.e. system orientation != device orientation) the resulting photo would be rotated incorrectly.

The system orientation is still required to calculate rotation for the preview view and has not be removed. The only change is the calculation of image rotation.

raedur commented 7 years ago

There may need to be a range of changes to comments and field names as the current codebase doesn't really differentiate between device rotation and system rotation and also uses the terms rotation and orientation interchangeably

dmitry-zaitsev commented 7 years ago

Thanks for the contribution!

I am still going through the code, but it works for me on my S7 Edge. There are, however, tests which are failing.

Diolor commented 6 years ago

Will close for sake of #180. Thanks @raedur #180's work was based on this!!