summaryrefslogtreecommitdiffstats
path: root/photoviewer
diff options
context:
space:
mode:
authorMark Wei <markwei@google.com>2012-08-30 13:23:01 -0700
committerMark Wei <markwei@google.com>2012-08-30 13:23:01 -0700
commit5da733e05a0cc73de0d56fba8a64a1839d75a028 (patch)
treee55a9fa982a2f8ff8df0fb4bd47664597a6e4719 /photoviewer
parent28bfd5ecc0d1828d1004f8a3163b738afc74967b (diff)
parentf688fc95529aae7aab75f631a9cffce9d20017f2 (diff)
downloadandroid_frameworks_ex-5da733e05a0cc73de0d56fba8a64a1839d75a028.tar.gz
android_frameworks_ex-5da733e05a0cc73de0d56fba8a64a1839d75a028.tar.bz2
android_frameworks_ex-5da733e05a0cc73de0d56fba8a64a1839d75a028.zip
resolved conflicts for merge of f688fc95 to master
Change-Id: Ib4ade547d76faa4a730b75ea691c1cf1f99888cd
Diffstat (limited to 'photoviewer')
-rw-r--r--photoviewer/src/com/android/ex/photo/loaders/PhotoBitmapLoader.java4
-rw-r--r--photoviewer/src/com/android/ex/photo/util/ImageUtils.java3
2 files changed, 5 insertions, 2 deletions
diff --git a/photoviewer/src/com/android/ex/photo/loaders/PhotoBitmapLoader.java b/photoviewer/src/com/android/ex/photo/loaders/PhotoBitmapLoader.java
index 7049370..fe42e0d 100644
--- a/photoviewer/src/com/android/ex/photo/loaders/PhotoBitmapLoader.java
+++ b/photoviewer/src/com/android/ex/photo/loaders/PhotoBitmapLoader.java
@@ -52,7 +52,9 @@ public class PhotoBitmapLoader extends AsyncTaskLoader<Bitmap> {
final ContentResolver resolver = context.getContentResolver();
Bitmap bitmap = ImageUtils.createLocalBitmap(resolver, Uri.parse(mPhotoUri),
PhotoViewFragment.sPhotoSize);
- bitmap.setDensity(DisplayMetrics.DENSITY_MEDIUM);
+ if (bitmap != null) {
+ bitmap.setDensity(DisplayMetrics.DENSITY_MEDIUM);
+ }
return bitmap;
}
diff --git a/photoviewer/src/com/android/ex/photo/util/ImageUtils.java b/photoviewer/src/com/android/ex/photo/util/ImageUtils.java
index 501356e..9c1636b 100644
--- a/photoviewer/src/com/android/ex/photo/util/ImageUtils.java
+++ b/photoviewer/src/com/android/ex/photo/util/ImageUtils.java
@@ -86,7 +86,7 @@ public class ImageUtils {
* @param uri The local URI
* @param maxSize The maximum size (either width or height)
*
- * @return The new bitmap
+ * @return The new bitmap or null
*/
public static Bitmap createLocalBitmap(ContentResolver resolver, Uri uri, int maxSize) {
// TODO: make this method not download the image for both getImageBounds and decodeStream
@@ -195,3 +195,4 @@ public class ImageUtils {
return resolver.openInputStream(uri);
}
}
+