summaryrefslogtreecommitdiffstats
path: root/src/com/android/camera/data/LocalData.java
diff options
context:
space:
mode:
authorAngus Kong <shkong@google.com>2013-06-26 18:32:17 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2013-06-26 18:32:17 +0000
commit1abc84c3ec015667ed8f15752b82459492db681d (patch)
treed653e29bd128cede9af9d1ae5fda8f02b874b68a /src/com/android/camera/data/LocalData.java
parent41752b2536bede41d81eddb8b813db42579be937 (diff)
parentc285458f6809d43333e3ada8790bddac17912e5a (diff)
downloadandroid_packages_apps_Snap-1abc84c3ec015667ed8f15752b82459492db681d.tar.gz
android_packages_apps_Snap-1abc84c3ec015667ed8f15752b82459492db681d.tar.bz2
android_packages_apps_Snap-1abc84c3ec015667ed8f15752b82459492db681d.zip
Merge "Fix check of failing decoding boundaries calls" into gb-ub-photos-carlsbad
Diffstat (limited to 'src/com/android/camera/data/LocalData.java')
-rw-r--r--src/com/android/camera/data/LocalData.java20
1 files changed, 6 insertions, 14 deletions
diff --git a/src/com/android/camera/data/LocalData.java b/src/com/android/camera/data/LocalData.java
index d509dc8ac..216c25a07 100644
--- a/src/com/android/camera/data/LocalData.java
+++ b/src/com/android/camera/data/LocalData.java
@@ -272,14 +272,16 @@ public interface LocalData extends FilmStripView.ImageData {
d.width = c.getInt(COL_WIDTH);
d.height = c.getInt(COL_HEIGHT);
if (d.width <= 0 || d.height <= 0) {
- Log.v(TAG, "warning! zero dimension for "
+ Log.w(TAG, "Warning! zero dimension for "
+ d.path + ":" + d.width + "x" + d.height);
- BitmapFactory.Options opts = decodeDimension(d.path);
- if (opts != null) {
+ BitmapFactory.Options opts = new BitmapFactory.Options();
+ opts.inJustDecodeBounds = true;
+ BitmapFactory.decodeFile(d.path, opts);
+ if (opts.outWidth != -1 && opts.outHeight != -1) {
d.width = opts.outWidth;
d.height = opts.outHeight;
} else {
- Log.v(TAG, "warning! dimension decode failed for " + d.path);
+ Log.w(TAG, "Warning! dimension decode failed for " + d.path);
Bitmap b = BitmapFactory.decodeFile(d.path);
if (b == null) {
return null;
@@ -331,16 +333,6 @@ public interface LocalData extends FilmStripView.ImageData {
return new PhotoBitmapLoadTask(v, decodeWidth, decodeHeight);
}
- private static BitmapFactory.Options decodeDimension(String path) {
- BitmapFactory.Options opts = new BitmapFactory.Options();
- opts.inJustDecodeBounds = true;
- Bitmap b = BitmapFactory.decodeFile(path, opts);
- if (b == null) {
- return null;
- }
- return opts;
- }
-
private final class PhotoBitmapLoadTask extends BitmapLoadTask {
private int mDecodeWidth;
private int mDecodeHeight;