Skip to content

Commit

Permalink
#1363 - fix rotation issues in certain cases introduced by #1293
Browse files Browse the repository at this point in the history
  • Loading branch information
budowski committed Sep 23, 2024
1 parent b1fee53 commit 555403f
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ public static String resizeImage(Context context, String path, Uri photoUri, int

int rotationDegrees = 0;

if (path != null) {
if (path != null && path.toLowerCase().endsWith("heic")) {
androidx.exifinterface.media.ExifInterface exif = new androidx.exifinterface.media.ExifInterface(path);
rotationDegrees = exif.getRotationDegrees();
}
Expand Down Expand Up @@ -466,7 +466,7 @@ public static String resizeImage(Context context, String path, Uri photoUri, int
Logger.tag(TAG).debug(String.format("resizeImage: %s => %s", path, imageFile.getAbsolutePath()));

resizedBitmap.recycle();
rotatedBitmap.recycle();
if (resizedBitmap != rotatedBitmap) rotatedBitmap.recycle();

// BitmapFactory.decodeStream moves the reading cursor
is.close();
Expand Down

0 comments on commit 555403f

Please sign in to comment.