Mirrored photo when using front camera

43 Views Asked by At

When i take a selfie, with Expo ImagePicker it mirrors the photo. it also saves it mirrored.

result = await ImagePicker.launchCameraAsync({ cameraType: ImagePicker.CameraType.front, presentationStyle: , allowsEditing: true, aspect: [1, 1], quality: 0.2, });

Is there any line of code to disable mirror?

I tried presentation style and it didnt work

1

There are 1 best solutions below

0
Henrique Mazer On

There doesn't seem to be a way to not flip the image when taking the picture, but you can flip it again after the picture is taking, using expo's ImageManipulator.

import { manipulateAsync, FlipType, SaveFormat } from 'expo-image-manipulator';

Then, create a new function and add this (remember to replace image.uri with your image uri):

const newImage = await manipulateAsync(
    image.uri,
    [{ flip: FlipType.Horizontal }],
    { compress: 1, format: SaveFormat.PNG }
);