diff --git a/media/java/android/media/ExifInterface.java b/media/java/android/media/ExifInterface.java index 58c6be9be4c71..5645ba5d7dacd 100644 --- a/media/java/android/media/ExifInterface.java +++ b/media/java/android/media/ExifInterface.java @@ -1794,15 +1794,13 @@ public class ExifInterface { // Set thumbnail image offset and length setThumbnailData(inputStream); mIsSupportedFile = true; - } catch (IOException e) { + } catch (IOException | OutOfMemoryError e) { // Ignore exceptions in order to keep the compatibility with the old versions of // ExifInterface. mIsSupportedFile = false; - if (DEBUG) { - Log.d(TAG, "Invalid image: ExifInterface got an unsupported image format file" - + "(ExifInterface supports JPEG and some RAW image formats only) " - + "or a corrupted JPEG file to ExifInterface.", e); - } + Log.w(TAG, "Invalid image: ExifInterface got an unsupported image format file" + + "(ExifInterface supports JPEG and some RAW image formats only) " + + "or a corrupted JPEG file to ExifInterface.", e); } finally { addDefaultValuesForCompatibility();