diff options
| author | Chih-Chung Chang <chihchung@google.com> | 2011-10-14 11:22:57 +0800 |
|---|---|---|
| committer | Chih-Chung Chang <chihchung@google.com> | 2011-10-14 12:32:29 +0800 |
| commit | b289d441eb5af97ac8716479831b1a2c5fe2e878 (patch) | |
| tree | 7af3d8380fa97036e1467376c9b284454837713e /src/com | |
| parent | 85bc435c06ace72f5da72475e9b03b0ada9455e0 (diff) | |
| download | android_packages_apps_Gallery2-b289d441eb5af97ac8716479831b1a2c5fe2e878.tar.gz android_packages_apps_Gallery2-b289d441eb5af97ac8716479831b1a2c5fe2e878.tar.bz2 android_packages_apps_Gallery2-b289d441eb5af97ac8716479831b1a2c5fe2e878.zip | |
Fix 5398768: Add requestCreateBitmapRegionDecoder for InputStream.
Change-Id: Ied273ffbabc134fdd930e6415fc175a6221eb662
Diffstat (limited to 'src/com')
| -rw-r--r-- | src/com/android/gallery3d/data/DecodeUtils.java | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/com/android/gallery3d/data/DecodeUtils.java b/src/com/android/gallery3d/data/DecodeUtils.java index 29b2aa738..b205576cd 100644 --- a/src/com/android/gallery3d/data/DecodeUtils.java +++ b/src/com/android/gallery3d/data/DecodeUtils.java @@ -33,6 +33,7 @@ import android.os.ParcelFileDescriptor; import java.io.FileDescriptor; import java.io.FileInputStream; +import java.io.InputStream; public class DecodeUtils { private static final String TAG = "DecodeService"; @@ -192,6 +193,18 @@ public class DecodeUtils { } public static BitmapRegionDecoder requestCreateBitmapRegionDecoder( + JobContext jc, InputStream is, boolean shareable) { + try { + return BitmapRegionDecoder.newInstance(is, shareable); + } catch (Throwable t) { + // We often cancel the creating of bitmap region decoder, + // so just log one line. + Log.w(TAG, "requestCreateBitmapRegionDecoder: " + t); + return null; + } + } + + public static BitmapRegionDecoder requestCreateBitmapRegionDecoder( JobContext jc, Uri uri, ContentResolver resolver, boolean shareable) { ParcelFileDescriptor pfd = null; |
