summaryrefslogtreecommitdiffstats
path: root/src/com/android/gallery3d/app/CropImage.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/gallery3d/app/CropImage.java')
-rw-r--r--src/com/android/gallery3d/app/CropImage.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/com/android/gallery3d/app/CropImage.java b/src/com/android/gallery3d/app/CropImage.java
index 835970b4f..4f450d85e 100644
--- a/src/com/android/gallery3d/app/CropImage.java
+++ b/src/com/android/gallery3d/app/CropImage.java
@@ -612,8 +612,14 @@ public class CropImage extends AbstractGalleryActivity {
int sample = BitmapUtils.computeSampleSizeLarger(
Math.max(scaleX, scaleY));
options.inSampleSize = sample;
+
+ // The decoding result is what we want if
+ // 1. The size of the decoded bitmap match the destination's size
+ // 2. The destination covers the whole output bitmap
+ // 3. No rotation
if ((rect.width() / sample) == dest.width()
&& (rect.height() / sample) == dest.height()
+ && (outputX == dest.width()) && (outputY == dest.height())
&& rotation == 0) {
// To prevent concurrent access in GLThread
synchronized (mRegionDecoder) {