diff options
author | Earl Ou <shunhsingou@google.com> | 2012-10-24 13:09:39 +0800 |
---|---|---|
committer | Earl Ou <shunhsingou@google.com> | 2012-11-07 13:37:11 +0800 |
commit | bb2a49c89d344c9cc90a19dd4900fa9d4729321c (patch) | |
tree | eafcb232628484d8545758a9c2b0b6b9433e35a9 /gallerycommon/src/com/android/gallery3d | |
parent | cd42404ea4453f0a85539890be8e73c38ed7fb69 (diff) | |
download | android_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/gallery3d')
-rw-r--r-- | gallerycommon/src/com/android/gallery3d/exif/ExifParser.java | 6 |
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); |