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

Camera - android - Image has wrong orientation #503

Closed
WIStudent opened this issue Jun 25, 2021 · 6 comments · Fixed by #510
Closed

Camera - android - Image has wrong orientation #503

WIStudent opened this issue Jun 25, 2021 · 6 comments · Fixed by #510

Comments

@WIStudent
Copy link

Bug Report

Plugin(s)

@capacitor/camera@1.0.2

Capacitor Version

Latest Dependencies:

  @capacitor/cli: 3.0.2
  @capacitor/core: 3.0.2
  @capacitor/android: 3.0.2
  @capacitor/ios: 3.0.2

Installed Dependencies:

  @capacitor/cli: 3.0.2
  @capacitor/core: 3.0.2
  @capacitor/android: 3.0.2
  @capacitor/ios: 3.0.2

Platform(s)

android

Current Behavior

When taking a picture with

Camera.getPhoto({
  source: CameraSource.Camera
  quality: 50,
  saveToGallery: false,
  correctOrientation: true,
  resultType: CameraResultType.Uri
})

and setting that image as a src of an <img> element, that image is not orientated correctly.

Expected Behavior

Image should have correct orientation.

Additional Context

This is probably caused by the changes made in #480. My best guess is that the final image now contains the exif orientation returned by the camera. But correctOrientation: true rotated the image without also updating the exif orientation. So the exif orientation in the final image is incorrect. Chrome then rotates the image using the exif orientation.

@Ionitron
Copy link
Collaborator

This issue may need more information before it can be addressed. In particular, it will need a reliable Code Reproduction that demonstrates the issue.

Please see the Contributing Guide for how to create a Code Reproduction.

Thanks!
Ionitron 💙

@WIStudent
Copy link
Author

Here's the reproduction repo: https://github.com/WIStudent/capacitor-camera-orientation-issue

@jcesarmobile
Copy link
Member

And what are the steps to reproduce?
I've been testing in a few different devices taking pictures in portrait, landscape left, landscape right and upside down and I don't see any issue

@WIStudent
Copy link
Author

I am seeing this issue on my Pixel 3a (Android 11, Android System WebView 91.0.4472.120)
Using the demo app I am taking a picture while holding the device in portrait orientation. After I took the picture, its rotated by 90 degrees clockwise in the web view.
When I am holding the device in landscape orientation (rotated clockwise) while taking the picture, the picture will be rotated 180 degrees in the web view.

@jcesarmobile
Copy link
Member

ah, yeah, could reproduce on Pixel 4, will work on a fix

@ionitron-bot
Copy link

ionitron-bot bot commented Sep 30, 2022

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of the plugin, please create a new issue and ensure the template is fully filled out.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Sep 30, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants