diff options
Diffstat (limited to 'gallerycommon/src/com/android/gallery3d/exif/ExifParser.java')
-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); |