react-native-image-resizer icon indicating copy to clipboard operation
react-native-image-resizer copied to clipboard

wrong rotation image

Open anhdo9797 opened this issue 4 years ago • 6 comments

My code: image

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 avatar Jan 25 '21 15:01 anhdo9797

@anhdo9797 Did you find a solution for this?

shakawy avatar Feb 14 '21 18:02 shakawy

@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 avatar Feb 15 '21 04:02 anhdo9797

@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 contains originalRotation (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

anhdo9797 avatar Feb 18 '21 08:02 anhdo9797

issue from react-native-image-picker side. i had to downgrade to v2 for now

shakawy avatar Mar 08 '21 16:03 shakawy

If you are using react-native-image-picker, setting rotation=360 and quality=0.99 as options solved my problem

imthims avatar Mar 25 '21 20:03 imthims

@sadhruva thx. will try it

shakawy avatar Mar 25 '21 20:03 shakawy

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.

stale[bot] avatar Sep 01 '22 18:09 stale[bot]

This issue has been automatically closed. Thank you for your contributions.

stale[bot] avatar Sep 08 '22 18:09 stale[bot]