Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Expo camera rotation

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

...

const takePic = async () => {
    if (!cameraRef) return;
    
    let photo = await cameraRef.takePictureAsync();

    if (cameraType === Camera.Constants.Type.front) {
        photo = await manipulateAsync(
            photo.localUri || photo.uri,
            [
                { rotate: 180 },
                { flip: FlipType.Vertical },
            ],
            { compress: 1, format: SaveFormat.PNG }
        );
    }

    setFrontProfile(photo.uri);
};
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #Expo #camera #rotation
ADD COMMENT
Topic
Name
6+2 =