summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--gallerycommon/src/com/android/gallery3d/exif/ExifInterface.java2
-rw-r--r--src/com/android/gallery3d/filtershow/cache/ImageLoader.java4
-rw-r--r--src/com/android/gallery3d/filtershow/tools/SaveImage.java2
3 files changed, 7 insertions, 1 deletions
diff --git a/gallerycommon/src/com/android/gallery3d/exif/ExifInterface.java b/gallerycommon/src/com/android/gallery3d/exif/ExifInterface.java
index a1cf0fc85..87db689e8 100644
--- a/gallerycommon/src/com/android/gallery3d/exif/ExifInterface.java
+++ b/gallerycommon/src/com/android/gallery3d/exif/ExifInterface.java
@@ -732,7 +732,7 @@ public class ExifInterface {
* @param inStream an InputStream containing a jpeg compressed image.
* @throws IOException
*/
- public void readExif(InputStream inStream) throws IOException {
+ public void readExif(InputStream inStream) throws IOException, NullPointerException {
if (inStream == null) {
throw new IllegalArgumentException(NULL_ARGUMENT_STRING);
}
diff --git a/src/com/android/gallery3d/filtershow/cache/ImageLoader.java b/src/com/android/gallery3d/filtershow/cache/ImageLoader.java
index 52c296c78..ea559e569 100644
--- a/src/com/android/gallery3d/filtershow/cache/ImageLoader.java
+++ b/src/com/android/gallery3d/filtershow/cache/ImageLoader.java
@@ -147,6 +147,8 @@ public final class ImageLoader {
return parseExif(exif);
} catch (IOException e) {
Log.w(LOGTAG, "Failed to read EXIF orientation", e);
+ } catch (NullPointerException e) {
+ Log.w(LOGTAG, "Invalid EXIF data", e);
} finally {
try {
if (is != null) {
@@ -576,6 +578,8 @@ public final class ImageLoader {
return taglist;
} catch (IOException e) {
Log.w(LOGTAG, "Failed to read EXIF tags", e);
+ } catch (NullPointerException e) {
+ Log.e(LOGTAG, "Failed to read EXIF tags", e);
}
}
return null;
diff --git a/src/com/android/gallery3d/filtershow/tools/SaveImage.java b/src/com/android/gallery3d/filtershow/tools/SaveImage.java
index 0c12fa4d9..ecf3e2fae 100644
--- a/src/com/android/gallery3d/filtershow/tools/SaveImage.java
+++ b/src/com/android/gallery3d/filtershow/tools/SaveImage.java
@@ -256,6 +256,8 @@ public class SaveImage {
Log.w(LOGTAG, "Cannot find file: " + source, e);
} catch (IOException e) {
Log.w(LOGTAG, "Cannot read exif for: " + source, e);
+ } catch (NullPointerException e) {
+ Log.w(LOGTAG, "Invalid exif data for: " + source, e);
} finally {
Utils.closeSilently(inStream);
}