From 68bda838d02877b2d21f94a386a1cacfd5addb1b Mon Sep 17 00:00:00 2001 From: Jin Park Date: Thu, 21 Jul 2016 10:27:57 +0900 Subject: [PATCH] ExifInterface: Remove unnecessary logging of exceptions ExifInterface currently logs exceptions when it encounters invalid markers and when the file format is unsupported by Piex Library. This CL suppresses such logs with the DEBUG marker. Bug: 30252745 Change-Id: Ia69183eaa5bf7ac2ff1dc95c0919b23b4a9f8c4e --- media/java/android/media/ExifInterface.java | 11 ++++++++--- media/jni/android_media_ExifInterface.cpp | 1 - 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/media/java/android/media/ExifInterface.java b/media/java/android/media/ExifInterface.java index 2c98e98eb963c..44c875bf97603 100644 --- a/media/java/android/media/ExifInterface.java +++ b/media/java/android/media/ExifInterface.java @@ -1578,9 +1578,11 @@ public class ExifInterface { } catch (IOException e) { // Ignore exceptions in order to keep the compatibility with the old versions of // ExifInterface. - 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); + if (DEBUG) { + 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(); @@ -1601,6 +1603,9 @@ public class ExifInterface { private boolean handleRawResult(HashMap map) { if (map == null) { + if (DEBUG) { + Log.d(TAG, "Raw image file not detected"); + } return false; } diff --git a/media/jni/android_media_ExifInterface.cpp b/media/jni/android_media_ExifInterface.cpp index 731deae146030..10b3170612505 100644 --- a/media/jni/android_media_ExifInterface.cpp +++ b/media/jni/android_media_ExifInterface.cpp @@ -130,7 +130,6 @@ static jobject getRawAttributes(JNIEnv* env, SkStream* stream, bool returnThumbn piex::PreviewImageData image_data; if (!GetExifFromRawImage(piexStream.get(), String8("[piex stream]"), image_data)) { - ALOGI("Raw image not detected"); return NULL; }