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
919 stars 207 forks source link

Selfies are flipped #255

Closed migalv closed 1 year ago

migalv commented 1 year ago

Steps to Reproduce

  1. Download the CamerAwesome example
  2. Install and run the app
  3. Take a picture in selfie mode
  4. Check output

Expected results

In my opinion, when taking pictures in selfie mode they should always be mirrored as this is the expected behavior by 99% of users.

Here is an example from Instagram:

Instagram

Actual results

The image is flipped and generates a strange sensation.

Example from CamerAwesome example code:

CamerAwesome

About your device

Brand Model OS
Huawei Huawei P30 EMUI 12.0.0

Flutter Doctor

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.3.10, on macOS 13.2 22D49 darwin-arm, locale en-ES)
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 14.2)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2021.1)
[✓] VS Code (version 1.75.0)
[✓] Connected device (2 available)
[✓] HTTP Host Availability

• No issues found!
g-apparence commented 1 year ago

Yes you're right. Added the enhancement label

istornz commented 1 year ago

We tested on latest iPhone 14 & on 3 Android devices (2 new, 1 old).

Only the old Android device (Huawei) did not perform a flip on the Selfie, all others do a Flip. So we think it's a manufacturer choice but in the major case it seems flip the selfie image is the best way to display a selfie image.

apalala-dev commented 1 year ago

On the native camera app of my Xiaomi Mi 9T, the picture taken is mirrored like expected from @migalv. After searching in the settings of the app, I found an option to set front camera pictures to be mirrored or not. Not sure if it was enabled by default or if I've set it manually. Overall, it seems to be an user/manufacturer choice, we should probably give an option to control it rather than expect a behaviour to be the right one for every one

migalv commented 1 year ago

I agree with @apalala-dev. This seems to be a users/manufacturer's choice. So if you allow the developer to choose the expected behavior for their app it would be a really good improvement.

istornz commented 1 year ago

Yeah of course, we can expose an option to flip the selfie or not !

On the Android side @apalala-dev did you flip the image manually ? I'm just worried about the flip was done on the cameraX part and AVCapture side ?

apalala-dev commented 1 year ago

I don't think there is any handmade flip made on the Android part. I am not sure if it can be done directly by CameraX (with a setting or something like that). The more problematic on the Android side is that I don't know if the image is flipped or not which means I don't know if the image needs to be flipped or not 😕 I hope that CameraX is consistent and is always flipped (or not flipped)...

apalala-dev commented 1 year ago

It's easier than expected on Android:

image

You might have something similar on the iOS part @istornz ?

apalala-dev commented 1 year ago

Apparently this is a feature quite demanded on the official plugin: https://github.com/flutter/flutter/issues/27650

We might get an other reason to implement it! 👀

istornz commented 1 year ago

@apalala-dev Yeah very easy on the iOS side too, we just need to remove the first condition 👍 It's a good idea to implement it !

Capture d’écran 2023-03-17 à 17 12 44

migalv commented 1 year ago

Apparently this is a feature quite demanded on the official plugin: flutter/flutter#27650

We might get an other reason to implement it! 👀

That's exactly right @apalala-dev

You guys are amazing! Let's go

istornz commented 1 year ago

Hi @migalv, I created a new PR to implement this feature on Dart & iOS sides #278. @apalala-dev will implement the Android part asap 👍