diff options
author | Daniel Lehmann <lehmannd@google.com> | 2012-03-27 13:15:13 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2012-03-27 13:15:13 -0700 |
commit | 2b3fc5a7984d3d698a44640b18800ba788cbd704 (patch) | |
tree | 918f3cad308f35f4d1ad068d645e4d8cac4bfb2c /src | |
parent | 4311d471a6666c20809f740331f146957c61af48 (diff) | |
parent | b0208fcd1c296f3eb2b8dfaa55e4fb4972b3d198 (diff) | |
download | packages_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.java | 4 |
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); } |