react-native-image-crop-picker icon indicating copy to clipboard operation
react-native-image-crop-picker copied to clipboard

Force image to stay in portrait mode

Open SL-A-SH opened this issue 5 years ago • 4 comments

Version

Tell us which versions you are using:

  • react-native-image-crop-picker v0.24.1
  • react-native v0.59.8

Platform

Tell us to which platform this issue is related

  • Android

Expected behaviour

The image should always display in portrait mode. I am making a business card scanning app. After taking a picture I am sending the picture to google api for text recognition.

When the image is on portrait mode like below, google is able to recognize the texts correctly: card2

But when the image is on landscape mode like below, google is not able to recognize anything. Weird right? card1

The thing is that the orientation is changed automatically after clicking the picture in the preview screen where Discard and Save buttons appear. Sometimes it's displayed as the first image and sometimes it's displayed as the second image.

So how do it make it to always display it like the first image so that after sending the image I get a correct response back from google.

If this is not an issue with the package then can someone help me out to fix it?

Actual behaviour

The image orientation is sometimes changed to landscape mode automatically.

SL-A-SH avatar May 30 '19 09:05 SL-A-SH

It happens to me too, you found a fix?

tximpa91 avatar Jun 11 '19 07:06 tximpa91

Nope. No luck yet.

SL-A-SH avatar Jun 11 '19 08:06 SL-A-SH

i had solved the problem,use react-native-image-picker and it has a params,called 'rotation' . rotation set to 90, the image it takes will always in portrait mode . then you can take the image'uri to react-native-image-crop- picker's cropper trust me it works

raintoway avatar Feb 15 '20 12:02 raintoway

i had solved the problem,use react-native-image-picker and it has a params,called 'rotation' . rotation set to 90, the image it takes will always in portrait mode . then you can take the image'uri to react-native-image-crop- picker's cropper trust me it works

const res = await ImagePicker.openCamera({ mediaType: 'photo', cropping: false, includeBase64: true, compressImageQuality: 0.5, rotation:90 })

Still base64 picture is rotated when I take picture in portrait mode

DonRyu avatar Jul 12 '22 18:07 DonRyu