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
: 0º
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' }]
orrotate: '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 0º.
Example:
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.