diff options
author | Ruben Brunk <rubenbrunk@google.com> | 2013-03-22 21:20:03 -0700 |
---|---|---|
committer | Ruben Brunk <rubenbrunk@google.com> | 2013-03-22 21:20:03 -0700 |
commit | f4486566491c2f6c51817f92ee1000d12db41c1b (patch) | |
tree | fc2e8303f07b1e171152a9238c3dba26c3eab9a9 /src/com/android/gallery3d/filtershow/filters/ImageFilterGeometry.java | |
parent | 476576159c2ecbfaca99c696b5b46c56b30f3d19 (diff) | |
download | android_packages_apps_Gallery2-f4486566491c2f6c51817f92ee1000d12db41c1b.tar.gz android_packages_apps_Gallery2-f4486566491c2f6c51817f92ee1000d12db41c1b.tar.bz2 android_packages_apps_Gallery2-f4486566491c2f6c51817f92ee1000d12db41c1b.zip |
Refactoring: removed unnecessary apply calls.
Change-Id: Ic592a00a8487f6a2499c34929b0ec8afad2a73b6
Diffstat (limited to 'src/com/android/gallery3d/filtershow/filters/ImageFilterGeometry.java')
-rw-r--r-- | src/com/android/gallery3d/filtershow/filters/ImageFilterGeometry.java | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/com/android/gallery3d/filtershow/filters/ImageFilterGeometry.java b/src/com/android/gallery3d/filtershow/filters/ImageFilterGeometry.java index cbb443f75..5a33cc823 100644 --- a/src/com/android/gallery3d/filtershow/filters/ImageFilterGeometry.java +++ b/src/com/android/gallery3d/filtershow/filters/ImageFilterGeometry.java @@ -22,6 +22,7 @@ import android.graphics.Matrix; import android.graphics.Paint; import android.graphics.Rect; import android.graphics.RectF; +import android.util.Log; import com.android.gallery3d.filtershow.CropExtras; import com.android.gallery3d.filtershow.imageshow.GeometryMath; @@ -72,7 +73,12 @@ public class ImageFilterGeometry extends ImageFilter { // TODO: implement bilinear or bicubic here... for now, just use // canvas to do a simple implementation... // TODO: and be more memory efficient! (do it in native?) - + RectF cb = mGeometry.getPreviewCropBounds(); + RectF pb = mGeometry.getPhotoBounds(); + if (cb.width() == 0 || cb.height() == 0 || pb.width() == 0 || pb.height() == 0) { + Log.w(LOGTAG, "Cannot apply geometry: geometry metadata has not been initialized"); + return bitmap; + } CropExtras extras = mGeometry.getCropExtras(); boolean useExtras = mGeometry.getUseCropExtrasFlag(); int outputX = 0; |