XamarinCommunityToolkit icon indicating copy to clipboard operation
XamarinCommunityToolkit copied to clipboard

CameraView images automatically rotate on Android

Open jfversluis opened this issue 3 years ago • 2 comments
trafficstars

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

  • Fixes #1695

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

jfversluis avatar Jun 09 '22 11:06 jfversluis

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

brettnguyen avatar Aug 01 '22 04:08 brettnguyen

@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 avatar Apr 13 '23 14:04 MFinkBK

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 avatar Apr 26 '24 07:04 jfversluis