summaryrefslogtreecommitdiffstats
path: root/gallerycommon/src
diff options
context:
space:
mode:
Diffstat (limited to 'gallerycommon/src')
-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 36e3b44..a6bbda0 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);