9

i'm using CameraRoll.getPhotos for get photos from gallery.

import {
  CameraRoll,
} from 'react-native';

CameraRoll.getPhotos(fetchParams).then((data) => {
});

I have a problem with the orientation of the images on some android phones. I have been able to detect what happens in most SAMSUNGs.

It has an orientation depending on the way you take the picture.

portrait with home button in bottom position: 90º
landscape with home button left position: 180º
portrait with home button in top position: 270º
landscape with home button right position:

Related with this issue

Base on CameraRoll Documentation the orientation value is not returned by getPhotos.

I'm try with:

  • transform: [{ rotateX: '0deg' }, { rotateY: '0deg' }] or rotate: '0deg'
  • Using react-native-media-meta for get metadata info (not works)
  • Use another image component instead native Image

but notting works. :(

The problem is that the images appear rotated in my application, but in the native gallery ignores the degree of rotation they have and shows them correctly with .

Example:

enter image description here

In this case the image appear with 90º and it's showed perfectly by native gallery but bad in my app.

- Is there any way to detect the current rotation of the image?
- Can the <Image> component be forced in some way to place the orientation at 0º?


UPDATE:

i found a library this module and its possible get the orientation of image and with that can fix this problem. But this process is very delayed and affect considerably the perfomance.

jose920405
  • 7,982
  • 6
  • 45
  • 71

0 Answers0