Merge "ExifInterface: return only a JPEG-compressed thumbnail of RAW images" into nyc-dev
diff --git a/media/jni/android_media_ExifInterface.cpp b/media/jni/android_media_ExifInterface.cpp
index 418a3f2..ae23720 100644
--- a/media/jni/android_media_ExifInterface.cpp
+++ b/media/jni/android_media_ExifInterface.cpp
@@ -136,7 +136,8 @@
KeyedVector<String8, String8> map;
- if (image_data.thumbnail.length > 0) {
+ if (image_data.thumbnail.length > 0
+ && image_data.thumbnail.format == ::piex::Image::kJpegCompressed) {
map.add(String8("hasThumbnail"), String8("true"));
map.add(String8("thumbnailOffset"), String8::format("%d", image_data.thumbnail.offset));
map.add(String8("thumbnailLength"), String8::format("%d", image_data.thumbnail.length));
diff --git a/media/jni/android_mtp_MtpDatabase.cpp b/media/jni/android_mtp_MtpDatabase.cpp
index 39f2a32..d6bf9ad 100644
--- a/media/jni/android_mtp_MtpDatabase.cpp
+++ b/media/jni/android_mtp_MtpDatabase.cpp
@@ -932,8 +932,9 @@
break;
}
- if (image_data.thumbnail.length == 0) {
- // No thumbnail.
+ if (image_data.thumbnail.length == 0
+ || image_data.thumbnail.format == ::piex::Image::kJpegCompressed) {
+ // No thumbnail or non jpeg thumbnail.
break;
}