summaryrefslogtreecommitdiffstats
path: root/gallerycommon/src/com/android
diff options
context:
space:
mode:
authorEarl Ou <shunhsingou@google.com>2012-10-24 13:09:39 +0800
committerEarl Ou <shunhsingou@google.com>2012-11-07 13:37:11 +0800
commitbb2a49c89d344c9cc90a19dd4900fa9d4729321c (patch)
treeeafcb232628484d8545758a9c2b0b6b9433e35a9 /gallerycommon/src/com/android
parentcd42404ea4453f0a85539890be8e73c38ed7fb69 (diff)
downloadandroid_packages_apps_Snap-bb2a49c89d344c9cc90a19dd4900fa9d4729321c.tar.gz
android_packages_apps_Snap-bb2a49c89d344c9cc90a19dd4900fa9d4729321c.tar.bz2
android_packages_apps_Snap-bb2a49c89d344c9cc90a19dd4900fa9d4729321c.zip
Handle wrong thumbnail tag type
Change-Id: If41834f0aa86425a06aaede815f3e0c3cdd17fd9
Diffstat (limited to 'gallerycommon/src/com/android')
-rw-r--r--gallerycommon/src/com/android/gallery3d/exif/ExifParser.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/gallerycommon/src/com/android/gallery3d/exif/ExifParser.java b/gallerycommon/src/com/android/gallery3d/exif/ExifParser.java
index 36e3b4468..a6bbda078 100644
--- a/gallerycommon/src/com/android/gallery3d/exif/ExifParser.java
+++ b/gallerycommon/src/com/android/gallery3d/exif/ExifParser.java
@@ -450,6 +450,12 @@ public class ExifParser {
*/
public int getCompressedImageSize() {
if (mJpegSizeTag == null) return 0;
+
+ // Some invalid image use short type tag
+ if (mJpegSizeTag.getDataType() == ExifTag.TYPE_UNSIGNED_SHORT) {
+ return mJpegSizeTag.getUnsignedShort(0);
+ }
+
// Cast unsigned int to int since the thumbnail is always smaller
// than the size of APP1 (65536)
return (int) mJpegSizeTag.getUnsignedLong(0);