Hi everybody.
I have a issue in using expo ImageManupulation. Below is my code for compress image after taken from camera.
import * as ImageManipulator from 'expo-image-manipulator';
takePhotoFromCamera = async() => {
let result = await ImagePicker.launchCameraAsync({
allowsEditing: true,
width: '100%',
height: '100%',
aspect: [1, 1],
});
if (!result.cancelled) {
var resizedPhoto;
if((result.width < result.height) && (result.width > 500)) {
resizedPhoto = await ImageManipulator.manipulateAsync(result.uri, [{ resize: { width: 500 }}], { format: 'jpeg', compress: 0.5});
} else if((result.width >= result.height) && (result.height > 500)) {
resizedPhoto = await ImageManipulator.manipulateAsync(result.uri, [{ resize: { height: 500 }}], { format: 'jpeg', compress: 0.5});
} else {
resizedPhoto = result;
}
this.uploadAvatar(resizedPhoto.uri);
}
};
await ImageManupulator.manipulateAsync is not working. So don’t run uploadAvatar() function.
That is, indefinitely wait manupulateAsync so don’t run uploadAvatar() function.
I have use in sdk30 and it was worked well, but after upgrading to sdk33, above function is not work well.
And on ios it works well, it don’t work well only on android.
Anyone who know to fix this issue advance me please. Thanks