Apparence-io / CamerAwesome

📸 Embedding a camera experience within your own app shouldn't be that hard. A flutter plugin to integrate awesome Android / iOS camera experience.
https://ApparenceKit.dev
MIT License
910 stars 199 forks source link

Camera uses wrong orientation on tablets - Android AND iOS #417

Closed InspectlyMads closed 4 months ago

InspectlyMads commented 7 months ago

Steps to Reproduce

I have conducted an evaluation utilizing the test example provided in the repository. When employing CameraAwesomeBuilder.awesome, an observation indicates a 45-degree rotation of the screen. This anomaly is consistently observed on both Android and iOS tablets.

Notably, both the camera view and the AwesomeOrientedWidget appear misaligned. In an attempt to rectify this issue, I experimented with various configurations of the 'getNativeOrientation' function, revealing an apparent reversal in orientations.

If it were a Flutter-related issue, I would be willing to address and resolve the problem. However, it appears that the EventChannel('camerawesome/orientation') is emitting incorrect signals, and I currently lack clarity on how to rectify this issue.

For tablets it seems: landscape_left corresponds to portrait_up landscape_right corresponds to portrait_down portrait_up corresponds to landscape_right portrait_down corresponds to landscape_left

Expected results

What it should be Orientations works fine on both android and iOS phones, which is the expected behavior for tablets as well.

Actual results

What you see image image

About your device

Brand Model OS
Emulator Pixel C All
Apple Ipad All

Your flutter version

Run this in your command line flutter --version

Flutter 3.10.5 • channel unknown • unknown source Framework • revision 796c8ef792 (6 months ago) • 2023-06-13 15:51:02 -0700 Engine • revision 45f6e00911 Tools • Dart 3.0.5 • DevTools 2.23.1

g-apparence commented 7 months ago

Will look if there is a clean way to detect tablets and rotate the preview.

InspectlyMads commented 6 months ago

@g-apparence Are there any progress on this issue? :)

benjamin-inspectly commented 6 months ago

@g-apparence Hi! Our clients are getting more and more impatient about this issue, since a lot of them uses iPads in their day-to-day work, and they feel like they have been patient until now :( Do you have any way to prioritize this issue? Thank you in advance.

DevNim98 commented 6 months ago

I know that is because camera awesome has the orientation fixed to portrait up, and that works really well on phones, since the buttons only need to rotate in their own axis. However in tablets, there is a roatation and displacement of the layout, you can see the animation if you open the native camera and rotate it in a tablet. You could make a workaround by having widgets to appear and dissapear depending on the orientation, and locking and unlocking screen rotation on demand, but it's only a workaround. There should be a different type of rotation for bigger screens like tablets, since locking and unlocking the rotation makes quite annoying animations that affect user experience. For example when you try to open the gallery while having the orientation fixed in the camera screen, locks also the orientation of the gallery and it's annoying. Hope they make a proper solution in the near future. But it's understandable that don't make it as fast since they probably have other issues and commitments apart from the plugin itself. Just be patient :)

g-apparence commented 6 months ago

I achieved a solution for this

Capture d’écran 2024-01-04 à 15 45 37

Took me a couple of hours and that's not that easy to have time these days. As DevNim told you I don't get any money from this plugin. I'm still working on it but I have a lot of work aside.

Anyway I've posted the current fix #432 here. Please test it before I can merge. I have tested this on emulators but as I don't have any real device I would prefer some real tests before merging it.

g-apparence commented 5 months ago

@benjamin-inspectly @InspectlyMads Did this solve your problem?

InspectlyMads commented 5 months ago

I achieved a solution for this

Capture d’écran 2024-01-04 à 15 45 37

Took me a couple of hours and that's not that easy to have time these days. As DevNim told you I don't get any money from this plugin. I'm still working on it but I have a lot of work aside.

Anyway I've posted the current fix #432 here. Please test it before I can merge. I have tested this on emulators but as I don't have any real device I would prefer some real tests before merging it.

I will look into testing this as soon as possible.

g-apparence commented 4 months ago

Should be fixed with last PR #448

InspectlyMads commented 4 months ago

Should be fixed with last PR #448

I've attempted updating to 'camerawesome: ^2.0.1', yet the issue persists. When I lock the OS orientation to portrait mode and then switch to landscape, it functions as expected - the camera button rotates correctly. However, relying on this workaround isn't feasible. I'm beginning to believe we need to do like the 'camera' package where the orientation doesn't seem to be locked, to achieve the desired behaviors.

Please consider opening the issue again, as the problem has not been fixed.

@g-apparence

arthurjgs commented 3 months ago

I still get the issue event with your latest commit on master (d1ebd5cf214fc9291d416c1b9b0bcff6f9b43513), do you plan to work on it ?

benjamin-inspectly commented 3 months ago

@g-apparence sorry to bother you with this again, but the problem still persists. Could you please reopen this issue? We tried forking the project to solve it ourselves but are clearly not camera-experts enough to solve it, sorry :(