diff options
Diffstat (limited to 'src/com/android/camera/gallery/UriImage.java')
-rw-r--r-- | src/com/android/camera/gallery/UriImage.java | 27 |
1 files changed, 9 insertions, 18 deletions
diff --git a/src/com/android/camera/gallery/UriImage.java b/src/com/android/camera/gallery/UriImage.java index f793999..88f67f6 100644 --- a/src/com/android/camera/gallery/UriImage.java +++ b/src/com/android/camera/gallery/UriImage.java @@ -74,28 +74,19 @@ class UriImage implements IImage { } public Bitmap fullSizeBitmap(int targetWidthHeight) { + return fullSizeBitmap(targetWidthHeight, IImage.ROTATE_AS_NEEDED, + IImage.NO_NATIVE); + } + + public Bitmap fullSizeBitmap(int targetWidthHeight, boolean rotateAsNeeded, + boolean useNative) { try { ParcelFileDescriptor pfdInput = getPFD(); - BitmapFactory.Options options = new BitmapFactory.Options(); - options.inJustDecodeBounds = true; - BitmapManager.instance().decodeFileDescriptor( - pfdInput.getFileDescriptor(), options); - - if (targetWidthHeight != -1) { - options.inSampleSize = - Util.computeSampleSize(options, targetWidthHeight); - } - - options.inJustDecodeBounds = false; - options.inDither = false; - options.inPreferredConfig = Bitmap.Config.ARGB_8888; - - Bitmap b = BitmapManager.instance().decodeFileDescriptor( - pfdInput.getFileDescriptor(), options); - pfdInput.close(); + Bitmap b = Util.makeBitmap(targetWidthHeight, pfdInput, + useNative); return b; } catch (Exception ex) { - Log.e(TAG, "got exception decoding bitmap " + ex.toString()); + Log.e(TAG, "got exception decoding bitmap ", ex); return null; } } |