react-native-image-resizer
react-native-image-resizer copied to clipboard
wrong rotation image
My code:
My devices: redmi note 8 "react-native": "0.63.0", "react-native-image-resizer": "^1.4.2", "react-native-image-picker": "3.1.3",
After take photo from camera then i recived a picturehad wrong rotated same the picture has been rotated -90/180 degrees Please help me, thanks all!!!
@anhdo9797 Did you find a solution for this?
@anhdo9797 Did you find a solution for this?
I resole my issue after read this comment: https://github.com/bamlab/react-native-image-resizer/pull/42#issue-83907735
I am replaced forder node_modules/react-native-image-resieze/android/src
similar to forder at repo https://github.com/bamlab/react-native-image-resizer/tree/master/android/src/main
@anhdo9797 Did you find a solution for this?
Update:
- when i use
react-native-image-picker
to select/ take an image, I have received respones containsoriginalRotation
(you can log ) and i used it to handle with resizer - example code:
`####################### import ImagePicker from 'react-native-image-picker'; import ImageResizer from 'react-native-image-resizer';
const option = { mediaType: 'photo', includeBase64: false, saveToPhotos: false, maxWidth: 600, maxHeight: 600, quality: 1, };
ImagePicker.launchCamera(option, (response) => { console.log('image picker', response); if (!response.didCancel){ const resizer = await ImageResizer.createResizedImage(response.uri, width, height, ..., 100, -response?.originalRotation || 0); return resize. } });
########################` I hope it can help you
issue from react-native-image-picker side. i had to downgrade to v2 for now
If you are using react-native-image-picker, setting rotation=360 and quality=0.99 as options solved my problem
@sadhruva thx. will try it
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This issue has been automatically closed. Thank you for your contributions.