From 3ba6835d576d6012468fabfc3f22e835172168c1 Mon Sep 17 00:00:00 2001 From: calderwoodra Date: Mon, 19 Jun 2017 16:03:01 -0700 Subject: Rotation Exif data is no longer lost when reducing size of cc images. BitmapFactory.createBitmap doesn't carry-over image exif data. We now hold onto exif data and reapply it through matrix transformations so images are displayed properly. Test: TH PiperOrigin-RevId: 159492684 Change-Id: Ief58f5fc506214e4a6afaf36a1be7dd53c712d4d --- .../com/android/dialer/callcomposer/camera/ImagePersistTask.java | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'java/com/android/dialer/callcomposer/camera') diff --git a/java/com/android/dialer/callcomposer/camera/ImagePersistTask.java b/java/com/android/dialer/callcomposer/camera/ImagePersistTask.java index 7cb6921e9..8620701fe 100644 --- a/java/com/android/dialer/callcomposer/camera/ImagePersistTask.java +++ b/java/com/android/dialer/callcomposer/camera/ImagePersistTask.java @@ -20,7 +20,6 @@ import android.annotation.TargetApi; import android.content.Context; import android.graphics.Bitmap; import android.graphics.BitmapFactory; -import android.graphics.Matrix; import android.net.Uri; import android.os.Build.VERSION_CODES; import android.support.v4.content.FileProvider; @@ -119,13 +118,9 @@ public class ImagePersistTask extends FallibleAsyncTask { mWidth = clippedWidth; mHeight = clippedHeight; - Matrix matrix = new Matrix(); - matrix.postRotate(params.rotation); - Bitmap clippedBitmap = - Bitmap.createBitmap( - bitmap, offsetLeft, offsetTop, clippedWidth, clippedHeight, matrix, true); - clippedBitmap = BitmapResizer.resizeForEnrichedCalling(clippedBitmap); + Bitmap.createBitmap(bitmap, offsetLeft, offsetTop, clippedWidth, clippedHeight); + clippedBitmap = BitmapResizer.resizeForEnrichedCalling(clippedBitmap, params.rotation); // EXIF data can take a big chunk of the file size and we've already manually rotated our image, // so remove all of the exif data. exifInterface.clearExif(); -- cgit v1.2.3