From 24bc9e24af37b2d0564a2503e32910b8ff82b96b Mon Sep 17 00:00:00 2001 From: Earl Ou Date: Fri, 19 Oct 2012 20:23:28 +0800 Subject: ignore image with invalid thumbnail type in Exif test Change-Id: I6fc3a2dde4caf881b3b63aa95f1997ee9ccd4dbc --- tests/src/com/android/gallery3d/exif/ExifReaderTest.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'tests/src') diff --git a/tests/src/com/android/gallery3d/exif/ExifReaderTest.java b/tests/src/com/android/gallery3d/exif/ExifReaderTest.java index 404946252..9916cd3ab 100644 --- a/tests/src/com/android/gallery3d/exif/ExifReaderTest.java +++ b/tests/src/com/android/gallery3d/exif/ExifReaderTest.java @@ -49,13 +49,13 @@ public class ExifReaderTest extends ExifXmlDataTestCase { private void checkThumbnail(ExifData exifData) { IfdData ifd1 = exifData.getIfdData(IfdId.TYPE_IFD_1); if (ifd1 != null) { - if (ifd1.getTag(ExifTag.TAG_COMPRESSION).getUnsignedShort(0) == - ExifTag.Compression.JPEG) { + int type = ifd1.getTag(ExifTag.TAG_COMPRESSION).getUnsignedShort(0); + if (type == ExifTag.Compression.JPEG) { assertTrue(getImageTitle(), exifData.hasCompressedThumbnail()); byte[] thumbnail = exifData.getCompressedThumbnail(); assertTrue(getImageTitle(), BitmapFactory.decodeByteArray(thumbnail, 0, thumbnail.length) != null); - } else { + } else if (type == ExifTag.Compression.UNCOMPRESSION) { // Try to check the strip count with the formula provided by EXIF spec. int planarType = ExifTag.PlanarConfiguration.CHUNKY; ExifTag planarTag = ifd1.getTag(ExifTag.TAG_PLANAR_CONFIGURATION); -- cgit v1.2.3