Images taken from camera being rotated 90 degrees counter-clockwise
See original GitHub issueCurrent behavior
Whenever I compress an image taken straight from the camera (in portrait mode) the image gets rotated 90 degrees counter-clockwise after compressed. This happens on the physical device (in my case, a Samsung Galaxy S10 Lite), but not on the Android Emulator.
I am using react-native-image-picker (version 4.7.3) to take the images and then compressing them using react-native-compressor before upload. Using react-native-image-picker itself does not rotate the image. The problem occurs specifically on android after I use the compressor to compress the image taken from react-native-image-picker. Here is the code:
import { Image as ImageCompressor } from 'react-native-compressor';
import { launchCamera } from 'react-native-image-picker';
addImageFromCamera = async () => {
const result = await launchCamera({
mediaType: 'photo',
saveToPhotos: true,
});
if (result.didCancel) {
return;
}
const compressedImage = await ImageCompressor.compress(result.assets[0].uri, { autoCompress: true });
return compressedImage;
}
The output is great! The image’s size is significantly reduced and the quality is still good. It is just the orientation issue bothering the users on Android(only).
Expected behavior
Compress the image keeping its original orientation.
Platform
- Android
React Native Version
0.61.5
React Native Compressor Version
0.5.17
Reproducible Steps And Demo
- Using an Android physical device, take an image from camera using react-native-image-picker (
lauchCamera()) - Pass the output result to react-native-compressor using the auto compression (
Image.compress(Image_URI_Here, { autoCompress: true })) - Check the result on the React Native’s Image component or look into your phone’s file manager to see if the image had its orientation changed from portrait to landscape.

Issue Analytics
- State:
- Created a year ago
- Reactions:2
- Comments:12
Top Related StackOverflow Question
Don’t think it’s only Samsung, I am checking it on OnePlus, same. it rotates.
+1