diff options
| author | Owen Lin <owenlin@google.com> | 2011-08-26 22:03:03 +0800 |
|---|---|---|
| committer | Owen Lin <owenlin@google.com> | 2011-08-26 22:03:03 +0800 |
| commit | 8cdfc6a0cd6b32f4c2baa64dbaddb8f496dced6d (patch) | |
| tree | 8c12a848a052a9d20f287a5149d01a71d06632f3 /gallerycommon | |
| parent | bd8e025f1bb39b2be236b183ea8e78f93b308ad1 (diff) | |
| download | android_packages_apps_Gallery2-8cdfc6a0cd6b32f4c2baa64dbaddb8f496dced6d.tar.gz android_packages_apps_Gallery2-8cdfc6a0cd6b32f4c2baa64dbaddb8f496dced6d.tar.bz2 android_packages_apps_Gallery2-8cdfc6a0cd6b32f4c2baa64dbaddb8f496dced6d.zip | |
Use getEmbeddedPicture to get thumbnail of a picture.
Change-Id: I69d0d2129906eb780df3940f0bdce0e84c5e2b1d
fix: 4190748
Diffstat (limited to 'gallerycommon')
| -rw-r--r-- | gallerycommon/src/com/android/gallery3d/common/BitmapUtils.java | 6 |
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) { |
