OSDN Git Service

ignore uncompressed thumbnail when test exif thumbnail
authorEarl Ou <shunhsingou@google.com>
Wed, 8 Aug 2012 07:20:01 +0000 (15:20 +0800)
committerEarl Ou <shunhsingou@google.com>
Wed, 8 Aug 2012 07:20:01 +0000 (15:20 +0800)
Change-Id: I32baae44994f3b113405082f55539e1a2a3db8bb

tests/src/com/android/gallery3d/exif/ExifParserTest.java

index 35f4f3f..8c47b14 100644 (file)
@@ -413,6 +413,12 @@ public class ExifParserTest extends InstrumentationTestCase {
                         long unsignedInt = ifdParser.readUnsignedInt();
                         assertTrue(unsignedInt <= Integer.MAX_VALUE);
                         thumbSize = (int) unsignedInt;
+                    } else if (tag.getTagId() == ExifTag.TIFF_TAG.TAG_COMPRESSION) {
+                        if (ifdParser.readUnsignedShort() ==
+                                ExifTag.TIFF_TAG.COMPRESSION_UNCOMPRESSION) {
+                            // This test doesn't apply to uncompression thumbnail.
+                            return;
+                        }
                     }
                     isFinishRead = thumbOffset != 0 && thumbSize != 0;
                     break;