diff options
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()); |