diff options
| author | Linux Build Service Account <lnxbuild@localhost> | 2016-04-05 00:14:17 -0700 |
|---|---|---|
| committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2016-04-05 00:14:17 -0700 |
| commit | 614f0b7869b026768c33c4fb7e82850e13e17bfa (patch) | |
| tree | 845ee48f5ce9cf1292762f2cc85c7f58256e1753 /src | |
| parent | b1010c0ae29a2789aed26da3aafab0509d6457ac (diff) | |
| parent | 432ad6e8048d3677de77d070bf571bea3d4831ea (diff) | |
| download | android_packages_apps_Gallery2-614f0b7869b026768c33c4fb7e82850e13e17bfa.tar.gz android_packages_apps_Gallery2-614f0b7869b026768c33c4fb7e82850e13e17bfa.tar.bz2 android_packages_apps_Gallery2-614f0b7869b026768c33c4fb7e82850e13e17bfa.zip | |
Merge "Gallery2: Adding message in failed case of SeeStraight" into android_ui.lnx.1.2-dev
Diffstat (limited to 'src')
| -rw-r--r-- | src/com/android/gallery3d/filtershow/filters/SeeStraightActs.java | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/src/com/android/gallery3d/filtershow/filters/SeeStraightActs.java b/src/com/android/gallery3d/filtershow/filters/SeeStraightActs.java index e9489595e..7ecae02cf 100644 --- a/src/com/android/gallery3d/filtershow/filters/SeeStraightActs.java +++ b/src/com/android/gallery3d/filtershow/filters/SeeStraightActs.java @@ -31,6 +31,7 @@ package com.android.gallery3d.filtershow.filters; import android.graphics.Bitmap; import android.util.Log; +import android.widget.Toast; import com.android.gallery3d.R; import com.android.gallery3d.filtershow.editors.SeeStraightEditor; @@ -39,6 +40,7 @@ public class SeeStraightActs extends SimpleImageFilter { public static final String SERIALIZATION_NAME = "SeeStraightActs"; private static final int MIN_WIDTH = 512; private static final int MIN_HEIGHT = 512; + private static final int MIN_INPUT_REQUIREMENT = 640; private static final boolean DEBUG = true; private static boolean isSeeStraightEnabled = true; @@ -83,11 +85,24 @@ public class SeeStraightActs extends SimpleImageFilter { if(width <= MIN_WIDTH && height <= MIN_HEIGHT) return bitmap; + if(width <= MIN_INPUT_REQUIREMENT || height <= MIN_INPUT_REQUIREMENT) { + sActivity.runOnUiThread(new Runnable() { + public void run() { + Toast.makeText(sActivity, sActivity.getResources().getString(R.string.seestraight_input_image_is_small), Toast.LENGTH_SHORT).show(); + } + }); + return bitmap; + } + Bitmap dstBitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888); int[] outputRoi = processImage(width, height, bitmap, dstBitmap); if(outputRoi == null) { - printDebug("See Straight filter is not effective"); - return dstBitmap; + sActivity.runOnUiThread(new Runnable() { + public void run() { + Toast.makeText(sActivity, sActivity.getResources().getString(R.string.seestraight_process_fail), Toast.LENGTH_SHORT).show(); + } + }); + return bitmap; } dstBitmap = Bitmap.createBitmap(dstBitmap, outputRoi[0], outputRoi[1], outputRoi[2], outputRoi[3]); return dstBitmap; |
