diff --git a/iNaturalist/src/main/java/org/inaturalist/android/ImageUtils.java b/iNaturalist/src/main/java/org/inaturalist/android/ImageUtils.java index be49b5f4..3454e45c 100644 --- a/iNaturalist/src/main/java/org/inaturalist/android/ImageUtils.java +++ b/iNaturalist/src/main/java/org/inaturalist/android/ImageUtils.java @@ -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(); } @@ -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();