From 9ab175f5902c66a266261ccf191bc2d213918eca Mon Sep 17 00:00:00 2001 From: Chris Wren Date: Thu, 25 Oct 2012 15:58:50 -0400 Subject: swap output dims after rotating image. Bug: 7410969 Change-Id: I7e2ba028ab00a763686992f8c4515350cbf0388f --- src/com/android/dreams/phototable/PhotoSource.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/com/android/dreams/phototable/PhotoSource.java b/src/com/android/dreams/phototable/PhotoSource.java index 7f1dd51..670bd02 100644 --- a/src/com/android/dreams/phototable/PhotoSource.java +++ b/src/com/android/dreams/phototable/PhotoSource.java @@ -191,18 +191,18 @@ public abstract class PhotoSource { if (data.orientation != 0) { log(TAG, "rotated by " + data.orientation + ": fixing"); + Matrix matrix = new Matrix(); + matrix.setRotate(data.orientation, + (float) Math.floor(image.getWidth() / 2f), + (float) Math.floor(image.getHeight() / 2f)); + image = Bitmap.createBitmap(image, 0, 0, + options.outWidth, options.outHeight, + matrix, true); if (data.orientation == 90 || data.orientation == 270) { int tmp = options.outWidth; options.outWidth = options.outHeight; options.outHeight = tmp; } - Matrix matrix = new Matrix(); - matrix.setRotate(data.orientation, - (float) image.getWidth() / 2, - (float) image.getHeight() / 2); - image = Bitmap.createBitmap(image, 0, 0, - options.outHeight, options.outWidth, - matrix, true); } log(TAG, "returning bitmap " + image.getWidth() + ", " + image.getHeight()); -- cgit v1.2.3