Always rotate the image with the proper up orientation on Android (#42)

This commit is contained in:
Andrew Shini 2016-09-04 18:20:00 +10:00 committed by Florian Rival
parent fff95be7c2
commit ab1a39bf54
1 changed files with 3 additions and 5 deletions

View File

@ -226,11 +226,9 @@ class ImageResizer {
// Rotate if necessary // Rotate if necessary
Bitmap rotatedImage = scaledImage; Bitmap rotatedImage = scaledImage;
if (rotation != 0) {
int orientation = getOrientation(context, Uri.parse(imagePath)); int orientation = getOrientation(context, Uri.parse(imagePath));
rotation = orientation + rotation; rotation = orientation + rotation;
rotatedImage = ImageResizer.rotateImage(scaledImage, rotation); rotatedImage = ImageResizer.rotateImage(scaledImage, rotation);
}
if (scaledImage != rotatedImage) { if (scaledImage != rotatedImage) {
scaledImage.recycle(); scaledImage.recycle();