Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

CameraView images automatically rotate on Android #1871

Closed
wants to merge 3 commits into from

Conversation

jfversluis
Copy link
Member

Description of Bug

Not sure if this is the full, final implementation yet because techinically this is a breaking change. The rotation of the image taken with CameraView on Android will be done automatically with this fix.

Earlier we "fixed" this bug by providing the rotation information and users had to rotate the image manually. This code will rotate the image automatically for them. But if users have the rotation fix in their app, now it will probably start showing up weird.

Issues Fixed

Behavioral Changes

Take a picture with CameraView on Android and notice the picture shows up the right way.

PR Checklist

  • Has a linked Issue, and the Issue has been approved
  • Has tests (if omitted, state reason in description)
  • Has samples (if omitted, state reason in description)
  • Rebased on top of main at time of PR
  • Changes adhere to coding standard

@brettnguyen
Copy link

@jfversluis when will this be merged to the main branch? And does this work with videos too?

@MFinkBK
Copy link
Contributor

MFinkBK commented Apr 13, 2023

@jfversluis I tried out your PR and it works nicely on Android. In order to be compatible with existing user side code that does its own rotation, the PR could be modified slightly. Instead of returning the original rotation angle to the user, return 0 instead:
original: OnPhoto(this, (filePath, stream.ToArray(), rotation));
modified: OnPhoto(this, (filePath, stream.ToArray(), 0));
What do you think?

@MFinkBK MFinkBK mentioned this pull request Apr 21, 2023
6 tasks
@jfversluis
Copy link
Member Author

Now that we're so close to the sunsetting of Xamarin (and therefore also Xamarin Community Toolkit) unfortunately we won't be able to take this in anymore, we're really sorry about that. Nevertheless, thank you so much for your time and effort that you have put into this PR, we really appreciate it.

Please have a look at the evolution of the Xamarin Community Toolkit, The .NET MAUI Community Toolkit. A lot of development has been going on there. Hopefully this issue was already fixed in that codebase. If not, feel free to port this over to there.

Again, thank you so much for being a contributor and Xamarin user!

@jfversluis jfversluis closed this Apr 26, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] [CameraView] [Android] Taken photos are rotated incorrectly
6 participants