summaryrefslogtreecommitdiffstats
path: root/gallerycommon/src/com/android/gallery3d/common
diff options
context:
space:
mode:
authorOwen Lin <owenlin@google.com>2011-08-26 22:03:03 +0800
committerOwen Lin <owenlin@google.com>2011-08-26 22:03:03 +0800
commitd26c253b21e0acf18c0fde5fcfa256100d39ebe5 (patch)
treee638c81f9b100005d088d644dfe6fb7046a1a673 /gallerycommon/src/com/android/gallery3d/common
parent11e7f198384fc18a624b27980fc65ef65fd3cbcb (diff)
downloadandroid_packages_apps_Snap-d26c253b21e0acf18c0fde5fcfa256100d39ebe5.tar.gz
android_packages_apps_Snap-d26c253b21e0acf18c0fde5fcfa256100d39ebe5.tar.bz2
android_packages_apps_Snap-d26c253b21e0acf18c0fde5fcfa256100d39ebe5.zip
Use getEmbeddedPicture to get thumbnail of a picture.
Change-Id: I69d0d2129906eb780df3940f0bdce0e84c5e2b1d fix: 4190748
Diffstat (limited to 'gallerycommon/src/com/android/gallery3d/common')
-rw-r--r--gallerycommon/src/com/android/gallery3d/common/BitmapUtils.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/gallerycommon/src/com/android/gallery3d/common/BitmapUtils.java b/gallerycommon/src/com/android/gallery3d/common/BitmapUtils.java
index 04cdc6142..df9b93fbd 100644
--- a/gallerycommon/src/com/android/gallery3d/common/BitmapUtils.java
+++ b/gallerycommon/src/com/android/gallery3d/common/BitmapUtils.java
@@ -18,6 +18,7 @@ package com.android.gallery3d.common;
import android.graphics.Bitmap;
import android.graphics.Bitmap.CompressFormat;
+import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Matrix;
import android.graphics.Paint;
@@ -227,6 +228,11 @@ public class BitmapUtils {
if (Build.VERSION.SDK_INT <= 9) {
return (Bitmap) clazz.getMethod("captureFrame").invoke(instance);
} else {
+ byte[] data = (byte[]) clazz.getMethod("getEmbeddedPicture").invoke(instance);
+ if (data != null) {
+ Bitmap bitmap = BitmapFactory.decodeByteArray(data, 0, data.length);
+ if (bitmap != null) return bitmap;
+ }
return (Bitmap) clazz.getMethod("getFrameAtTime").invoke(instance);
}
} catch (IllegalArgumentException ex) {