I want to compress image using expo-image-manipulator. I followed documentation Expo-ImageManipulator. Everything seems fine but i get "Cannot read property 'ExpoImageManipulator' of undefined". Have you ever faced this error?
import { manipulateAsync } from "expo-image-manipulator";
const manipResult = async (imageUri) =>
await manipulateAsync(
imageUri,
[{ resize: { width: 640, height: 480 } }],
);
CodePudding user response:
Sorry, i don't have an enough reputation so can't do comment, only answer... Did you try do their examples with all params for manipulateAsunc?
const _rotate90andFlip = async () => {
const manipResult = await manipulateAsync(
image.localUri || image.uri, // maybe you don't have this value
[
{ rotate: 90 },
{ flip: FlipType.Vertical },
],
{ compress: 1, format: SaveFormat.PNG } // or need add this
);
setImage(manipResult);
};
CodePudding user response:
I downgraded version of expo-image-manipulator. Now it works.
