From 3bbcbcd5f908cef5c0bf7078c3352185f1ff6ddc Mon Sep 17 00:00:00 2001 From: Owen Lin Date: Tue, 15 May 2012 09:59:19 -0700 Subject: Release the constraint on the requested version. Allowing to request a region that partially outsides the image. bug: 5884845 Change-Id: I32344930ab9e2a7f22a706914babb165843e8de7 --- graphics/java/android/graphics/BitmapRegionDecoder.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'graphics') diff --git a/graphics/java/android/graphics/BitmapRegionDecoder.java b/graphics/java/android/graphics/BitmapRegionDecoder.java index 496e0c7..c1d3407 100644 --- a/graphics/java/android/graphics/BitmapRegionDecoder.java +++ b/graphics/java/android/graphics/BitmapRegionDecoder.java @@ -180,9 +180,9 @@ public final class BitmapRegionDecoder { */ public Bitmap decodeRegion(Rect rect, BitmapFactory.Options options) { checkRecycled("decodeRegion called on recycled region decoder"); - if (rect.left < 0 || rect.top < 0 || rect.right > getWidth() - || rect.bottom > getHeight()) - throw new IllegalArgumentException("rectangle is not inside the image"); + if (rect.right <= 0 || rect.bottom <= 0 || rect.left >= getWidth() + || rect.top >= getHeight()) + throw new IllegalArgumentException("rectangle is outside the image"); return nativeDecodeRegion(mNativeBitmapRegionDecoder, rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top, options); } -- cgit v1.1