diff options
| author | kaiyiz <kaiyiz@codeaurora.org> | 2014-02-27 17:34:55 +0800 |
|---|---|---|
| committer | emancebo <emancebo@cyngn.com> | 2014-09-04 10:40:19 -0700 |
| commit | a8bb13b5c19fea1e711f260fbbfa2245e422e08f (patch) | |
| tree | 097399530e018e7e720b798c99973dd6129ba1b9 | |
| parent | 25373c95103dbd7b63b990bf3b45425b1b838977 (diff) | |
| download | android_packages_apps_Gallery2-a8bb13b5c19fea1e711f260fbbfa2245e422e08f.tar.gz android_packages_apps_Gallery2-a8bb13b5c19fea1e711f260fbbfa2245e422e08f.tar.bz2 android_packages_apps_Gallery2-a8bb13b5c19fea1e711f260fbbfa2245e422e08f.zip | |
Gallery2: fix can not crop large *.bmp picture
It returns an equivalent scaled cropBounds as true
crop bounds, then it set the rounded rect by rounding
"out" the true crop rect, this make the rounded crop
rect may out range of the original bitmap, then an error
will happen.
We change to check the rounded crop rect, if it is out
the range of original bitmap, we set the original bitmap
bounds as rounded crop bounds.
CRs-Fixed: 621889
Change-Id: Ifb63754255b618fe65a4064663dfb4962bfdf8b8
| -rw-r--r-- | src/com/android/gallery3d/filtershow/crop/CropActivity.java | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/com/android/gallery3d/filtershow/crop/CropActivity.java b/src/com/android/gallery3d/filtershow/crop/CropActivity.java index f06886b0a..9a691f4a8 100644 --- a/src/com/android/gallery3d/filtershow/crop/CropActivity.java +++ b/src/com/android/gallery3d/filtershow/crop/CropActivity.java @@ -478,6 +478,14 @@ public class CropActivity extends Activity { failure = true; return false; } + if (roundedTrueCrop.right > mOrig.right) { + roundedTrueCrop.set(roundedTrueCrop.left, roundedTrueCrop.top, + (int) mOrig.right, roundedTrueCrop.bottom); + } + if (roundedTrueCrop.bottom > mOrig.bottom) { + roundedTrueCrop.set(roundedTrueCrop.left, roundedTrueCrop.top, + roundedTrueCrop.right, (int) mOrig.bottom); + } // Attempt to open a region decoder BitmapRegionDecoder decoder = null; |
