I'm trying to use Expo ImageManipulator to resize an image selected from device.
The result I'm getting is a weird object like this, so it doesn't work:
{"_h": 0, "_i": 0, "_j": null, "_k": null}
Why would it be so?
Here's my code:
...
import { manipulateAsync, SaveFormat } from "expo-image-manipulator";
const resizeImage = async (image) => {
return await manipulateAsync(
image.uri,
[
{
resize: {
width: 300,
},
},
],
{
format: SaveFormat.JPEG,
}
);
};
Your
resizeImagefunction is anasyncfunction. While calling this function you will either need to await (in a try-catch block) the function call or usePromise Chaining1st Method:
2nd Method: