camera-samples icon indicating copy to clipboard operation
camera-samples copied to clipboard

Camera2Basic: ExifUtils has a condition conflict for computing orientation

Open mjsobremonte opened this issue 5 years ago • 1 comments

Camera2Basic/utils/src/main/java/com/example/android/camera/utils/ExifUtils.kt

image

Line 32 conflicts with line 35 and causes saved images to be mirrored incorrectly. Simply removing line 32 solved my issue.

mjsobremonte avatar Dec 18 '20 12:12 mjsobremonte

The bug pointed out is definitely a bug, but I think the solution as suggsted is not complete - the 270 !mirrored case should be ORIENTATION_ROTATE_270 and the 270 mirrored case should be ORIENTATION_TRANSVERSE - this would be analgous to the other cases where the !mirrored case always is a simple rotate (without a flip). This gives me correct results, for example when photographing a keyboard, the result is not reversed, using a device that has 270 rotation and where the front camera gives a mirrored image and the rear camera a non-mirrored image. I see that msjobremonte and evidently others got good results with the opposite solution, so I'm a bit puzzled.

andy-weinstein avatar Feb 18 '21 13:02 andy-weinstein