summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDaniel Lehmann <lehmannd@google.com>2012-03-27 13:15:13 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-03-27 13:15:13 -0700
commit2b3fc5a7984d3d698a44640b18800ba788cbd704 (patch)
tree918f3cad308f35f4d1ad068d645e4d8cac4bfb2c /src
parent4311d471a6666c20809f740331f146957c61af48 (diff)
parentb0208fcd1c296f3eb2b8dfaa55e4fb4972b3d198 (diff)
downloadpackages_providers_ContactsProvider-2b3fc5a7984d3d698a44640b18800ba788cbd704.zip
packages_providers_ContactsProvider-2b3fc5a7984d3d698a44640b18800ba788cbd704.tar.gz
packages_providers_ContactsProvider-2b3fc5a7984d3d698a44640b18800ba788cbd704.tar.bz2
Merge "Don't upsize non-square pictures, even when cropping"
Diffstat (limited to 'src')
-rw-r--r--src/com/android/providers/contacts/PhotoProcessor.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/com/android/providers/contacts/PhotoProcessor.java b/src/com/android/providers/contacts/PhotoProcessor.java
index de6e93a..d2a33d2 100644
--- a/src/com/android/providers/contacts/PhotoProcessor.java
+++ b/src/com/android/providers/contacts/PhotoProcessor.java
@@ -134,10 +134,10 @@ import java.io.IOException;
}
}
float scaleFactor = ((float) maxDim) / Math.max(width, height);
- if (scaleFactor < 1.0 || cropLeft != 0 || cropTop != 0) {
+ if (scaleFactor < 1.0f || cropLeft != 0 || cropTop != 0) {
// Need to scale or crop the photo.
Matrix matrix = new Matrix();
- matrix.setScale(scaleFactor, scaleFactor);
+ if (scaleFactor < 1.0f) matrix.setScale(scaleFactor, scaleFactor);
scaledBitmap = Bitmap.createBitmap(
mOriginal, cropLeft, cropTop, width, height, matrix, false);
}