From ab1a39bf54201759ba77c5a09efd540269a9ac33 Mon Sep 17 00:00:00 2001 From: Andrew Shini Date: Sun, 4 Sep 2016 18:20:00 +1000 Subject: [PATCH] Always rotate the image with the proper up orientation on Android (#42) --- .../main/java/fr/bamlab/rnimageresizer/ImageResizer.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/android/src/main/java/fr/bamlab/rnimageresizer/ImageResizer.java b/android/src/main/java/fr/bamlab/rnimageresizer/ImageResizer.java index c041742..b3df47a 100644 --- a/android/src/main/java/fr/bamlab/rnimageresizer/ImageResizer.java +++ b/android/src/main/java/fr/bamlab/rnimageresizer/ImageResizer.java @@ -226,11 +226,9 @@ class ImageResizer { // Rotate if necessary Bitmap rotatedImage = scaledImage; - if (rotation != 0) { - int orientation = getOrientation(context, Uri.parse(imagePath)); - rotation = orientation + rotation; - rotatedImage = ImageResizer.rotateImage(scaledImage, rotation); - } + int orientation = getOrientation(context, Uri.parse(imagePath)); + rotation = orientation + rotation; + rotatedImage = ImageResizer.rotateImage(scaledImage, rotation); if (scaledImage != rotatedImage) { scaledImage.recycle();