diff options
author | Chris Wren <cwren@android.com> | 2012-10-25 15:58:50 -0400 |
---|---|---|
committer | Chris Wren <cwren@android.com> | 2012-10-25 17:22:47 -0400 |
commit | 9ab175f5902c66a266261ccf191bc2d213918eca (patch) | |
tree | 46586281a09152e6c09a924a3d36bcba28724f34 /src | |
parent | 68bc9d986e8eb882dc5f15defea0dab45c440ab6 (diff) | |
download | android_packages_screensavers_PhotoTable-9ab175f5902c66a266261ccf191bc2d213918eca.tar.gz android_packages_screensavers_PhotoTable-9ab175f5902c66a266261ccf191bc2d213918eca.tar.bz2 android_packages_screensavers_PhotoTable-9ab175f5902c66a266261ccf191bc2d213918eca.zip |
swap output dims after rotating image.
Bug: 7410969
Change-Id: I7e2ba028ab00a763686992f8c4515350cbf0388f
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/dreams/phototable/PhotoSource.java | 14 |
1 files changed, 7 insertions, 7 deletions
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()); |