diff options
author | Ruben Brunk <rubenbrunk@google.com> | 2013-01-15 17:23:40 -0800 |
---|---|---|
committer | Ruben Brunk <rubenbrunk@google.com> | 2013-01-15 17:27:03 -0800 |
commit | aeb7d79d2a35f534276bc6bf8128349f9768ae6b (patch) | |
tree | 2f006ac3bd9d397f47da052733055db11cb7facd /gallerycommon | |
parent | 63a7dac01d394523799939596b960cb03321798d (diff) | |
download | android_packages_apps_Gallery2-aeb7d79d2a35f534276bc6bf8128349f9768ae6b.tar.gz android_packages_apps_Gallery2-aeb7d79d2a35f534276bc6bf8128349f9768ae6b.tar.bz2 android_packages_apps_Gallery2-aeb7d79d2a35f534276bc6bf8128349f9768ae6b.zip |
Fix exif data saving for picasa images.
Bug: 7910836
Change-Id: I8ec1a1ab379c35b0602689a8f7850f5c861e0189
Diffstat (limited to 'gallerycommon')
-rw-r--r-- | gallerycommon/src/com/android/gallery3d/common/Utils.java | 5 | ||||
-rw-r--r-- | gallerycommon/src/com/android/gallery3d/exif/ExifParser.java | 4 |
2 files changed, 6 insertions, 3 deletions
diff --git a/gallerycommon/src/com/android/gallery3d/common/Utils.java b/gallerycommon/src/com/android/gallery3d/common/Utils.java index 3a68745c4..614a081c8 100644 --- a/gallerycommon/src/com/android/gallery3d/common/Utils.java +++ b/gallerycommon/src/com/android/gallery3d/common/Utils.java @@ -26,6 +26,7 @@ import android.text.TextUtils; import android.util.Log; import java.io.Closeable; +import java.io.IOException; import java.io.InterruptedIOException; public class Utils { @@ -173,8 +174,8 @@ public class Utils { if (c == null) return; try { c.close(); - } catch (Throwable t) { - Log.w(TAG, "close fail", t); + } catch (IOException t) { + Log.w(TAG, "close fail ", t); } } diff --git a/gallerycommon/src/com/android/gallery3d/exif/ExifParser.java b/gallerycommon/src/com/android/gallery3d/exif/ExifParser.java index a1ce13e69..1e4803f68 100644 --- a/gallerycommon/src/com/android/gallery3d/exif/ExifParser.java +++ b/gallerycommon/src/com/android/gallery3d/exif/ExifParser.java @@ -179,6 +179,9 @@ public class ExifParser { private ExifParser(InputStream inputStream, int options) throws IOException, ExifInvalidFormatException { + if (inputStream == null) { + throw new IOException("Null argument inputStream to ExifParser"); + } mContainExifData = seekTiffData(inputStream); mTiffStream = new CountedDataInputStream(inputStream); mOptions = options; @@ -682,7 +685,6 @@ public class ExifParser { private boolean seekTiffData(InputStream inputStream) throws IOException, ExifInvalidFormatException { CountedDataInputStream dataStream = new CountedDataInputStream(inputStream); - if (dataStream.readShort() != JpegHeader.SOI) { throw new ExifInvalidFormatException("Invalid JPEG format"); } |