diff options
author | calderwoodra <calderwoodra@google.com> | 2017-06-19 16:03:01 -0700 |
---|---|---|
committer | Eric Erfanian <erfanian@google.com> | 2017-06-21 16:01:01 +0000 |
commit | 3ba6835d576d6012468fabfc3f22e835172168c1 (patch) | |
tree | e8ce3ef0865f3f6997daff95de295dae88ae6fbe /java/com/android/dialer/callcomposer/camera | |
parent | 77576d6cf2e2babd3dff67c0c4ff692ea46f9b3d (diff) |
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
Diffstat (limited to 'java/com/android/dialer/callcomposer/camera')
-rw-r--r-- | java/com/android/dialer/callcomposer/camera/ImagePersistTask.java | 9 |
1 files changed, 2 insertions, 7 deletions
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<Void, Void, Uri> { 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(); |