Closed Nkurayijahubert closed 6 years ago
Front or back camera? Also which device?
A similar problem. Front (base) camera. In landscape mode, the second shot has an incorrect orientation. Steps:
That's a different issue @scifinder, thanks. It's already reported in #193
@Diolor it's on back camera, on Nexus 5x phone.
any solutions or workarounds yet?
I would like to ask the same, @Diolor
@Diolor, Any solution?
No, but you can send a PR @Nkurayijahubert !
@Nkurayijahubert could you please share a sample photo with us?
@dmitry-zaitsev Here is the sample image
@dmitry-zaitsev as you can see phone is in portrait orientation but the image comes in landscape orientation
@Nkurayijahubert please share the actual JPG image, not just the screenshot. I am trying to figure out what Exif properties the file has.
Ok, here it's @dmitry-zaitsev
@dmitry-zaitsev before to open it's in landscape but in preview it become portrait, as you can see in that comment above.
@Nkurayijahubert this is not the bug of Fotoapparat but the missing feature in your image viewer. The JPG file contains information about the image orientation and it is a responsibility of the viewer to rotate the image accordingly.
@dmitry-zaitsev what do you mean by image viewer? is it manufacturing issue or how the user has configured?
@Nkurayijahubert by the viewer I mean the Android application you use to view the image on your device.
Ok, Thank you @dmitry-zaitsev let try to fix the issue
Hi so I was facing this issue, and figure out that I just needed to rotate the image of 90 degrees if the width < height, meaning that the image is in landscape mode.
photoResult?.toBitmap()?.whenAvailable { photo ->
photo?.apply {
// Avoid the landscape image preview
var bitmap = if (this.bitmap.width < this.bitmap.height) this.bitmap else this.bitmap.rotate(90)
Log.i(LOGGING_TAG, "New photo captured. Bitmap length: ${this.bitmap.byteCount}")
}
?: Log.e(LOGGING_TAG, "Couldn't capture photo.")
}
Thanks @antoineFrau It's working fine
Hello,
Am facing an issue, where image is being saved in different orientation from that of screen, if screen is in portrait mode image will be in landscape and vise-versa. Any help!