RedApparat / Fotoapparat

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

Even if the screen orientation is locked, the device will render corr… #180

Closed Diolor closed 6 years ago

Diolor commented 6 years ago

Even if the screen orientation is locked, the device will render correctly the image rotation.

Diolor commented 6 years ago

Based on #90

jpribble commented 6 years ago

I think this PR may have introduced a regression. I've seen an issue occur a couple times in the past few days where logcat continuously repeats the following logs very quickly:

01-25 14:40:59.920 31137-32195/ D/Fotoapparat: CameraDevice: setDisplayOrientation 01-25 14:40:59.920 31137-32195/ D/Fotoapparat: Image orientation is: io.fotoapparat.hardware.orientation.Orientation$Vertical$Portrait@f012458. Display orientation is: io.fotoapparat.hardware.orientation.Orientation$Vertical$Portrait@f012458. Preview orientation is: io.fotoapparat.hardware.orientation.Orientation$Vertical$Portrait@f012458. 01-25 14:40:59.962 31137-32195/ D/Fotoapparat: CameraDevice: setDisplayOrientation 01-25 14:40:59.962 31137-32195/ D/Fotoapparat: Image orientation is: io.fotoapparat.hardware.orientation.Orientation$Horizontal$ReverseLandscape@7dfc53b. Display orientation is: io.fotoapparat.hardware.orientation.Orientation$Vertical$Portrait@f012458. Preview orientation is: io.fotoapparat.hardware.orientation.Orientation$Vertical$Portrait@f012458. 01-25 14:40:59.978 31137-32195/ D/Fotoapparat: CameraDevice: setDisplayOrientation 01-25 14:40:59.978 31137-32195/ D/Fotoapparat: Image orientation is: io.fotoapparat.hardware.orientation.Orientation$Vertical$Portrait@f012458. Display orientation is: io.fotoapparat.hardware.orientation.Orientation$Vertical$Portrait@f012458. Preview orientation is: io.fotoapparat.hardware.orientation.Orientation$Vertical$Portrait@f012458. 01-25 14:41:00.035 31137-32195/ D/Fotoapparat: CameraDevice: setDisplayOrientation 01-25 14:41:00.035 31137-32195/ D/Fotoapparat: Image orientation is: io.fotoapparat.hardware.orientation.Orientation$Horizontal$ReverseLandscape@7dfc53b. Display orientation is: io.fotoapparat.hardware.orientation.Orientation$Vertical$Portrait@f012458. Preview orientation is: io.fotoapparat.hardware.orientation.Orientation$Vertical$Portrait@f012458. ...

and occasionally the camera preview images get distorted. The image appears stretched as if a landscape image is trying to be displayed as portrait. Do you know what could be causing this? I've seen it occur on a Samsung GS8 and GS6 with the device's orientation locked to portrait and the camera activity's orientation locked to landscape.

jpribble commented 6 years ago

@Diolor Would it be possible to add a configuration to enable/disable this fix? For my use case, if the camera activity is locked to landscape, I expect the photos to always be delivered with landscape orientation. If the user holds the device flat (parallel with the surface of the ground) the device's orientation is unreliable and will cause photos to be rotated unexpectedly.

Diolor commented 6 years ago

Regarding the logcat above, might be the orentation listener. Maybe we could improve this.

About the orientation when in locked (reverse) landscape, I actually had not tested it. Only the portrait mode. Might be related to #193