react-native-image-resizer: orientation / rotation bug

When I take a photo with Samsung S8 in portrait mode, the camera app tells me orientation is 90.

If I apply this orientation to the resize, the image comes out correct. However, this now breaks every single other device.

Surely the rotate could should look like like this

Bitmap rotatedImage = ImageResizer.rotateImage(scaledImage, rotation);

instead of

Bitmap rotatedImage = scaledImage;
int orientation = getOrientation(context, Uri.parse(imagePath));
rotation = orientation + rotation;
rotatedImage = ImageResizer.rotateImage(scaledImage, rotation);

I cant understand why we would want to rotate by exif orientation PLUS whatever rotation value the user passes in?

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 2
  • Comments: 17 (3 by maintainers)

Commits related to this issue

Most upvoted comments