ExifInterface: return only a JPEG-compressed thumbnail of RAW images
Bug: 26923978 Change-Id: I120723c9e28a24d6fb3b7034892e0196484ee5e4
This commit is contained in:
@@ -136,7 +136,8 @@ static jobject getRawAttributes(JNIEnv* env, SkStream* stream, bool returnThumbn
|
||||
|
||||
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));
|
||||
|
||||
@@ -932,8 +932,9 @@ void* MyMtpDatabase::getThumbnail(MtpObjectHandle handle, size_t& outThumbSize)
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user