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
commit79a457d330a4d889ffe0a573b1e8f4a1a6287234 (patch)
tree46a38405c6f1ed7fab7290d8d8cd7574a62e340f /gallerycommon/src/com/android
parent28a814faa876e1291c3b2d5cbc0ebb78e9df5221 (diff)
downloadandroid_packages_apps_Gallery2-79a457d330a4d889ffe0a573b1e8f4a1a6287234.tar.gz
android_packages_apps_Gallery2-79a457d330a4d889ffe0a573b1e8f4a1a6287234.tar.bz2
android_packages_apps_Gallery2-79a457d330a4d889ffe0a573b1e8f4a1a6287234.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);