From a393402c67ab65c322a1ce4c2f6714397591c363 Mon Sep 17 00:00:00 2001 From: Earl Ou Date: Wed, 29 Aug 2012 10:21:23 +0800 Subject: Redesign the set function of ExifTag Change-Id: Iaf5632d759fe14c167cba54099b99719b31e3431 --- tests/src/com/android/gallery3d/exif/ExifParserTest.java | 2 +- tests/src/com/android/gallery3d/exif/ExifReaderTest.java | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'tests') diff --git a/tests/src/com/android/gallery3d/exif/ExifParserTest.java b/tests/src/com/android/gallery3d/exif/ExifParserTest.java index 241aaf575..e967e3d28 100644 --- a/tests/src/com/android/gallery3d/exif/ExifParserTest.java +++ b/tests/src/com/android/gallery3d/exif/ExifParserTest.java @@ -210,7 +210,7 @@ public class ExifParserTest extends InstrumentationTestCase { case ExifParser.EVENT_NEW_TAG: ExifTag tag = parser.getTag(); if (tag.getTagId() == ExifTag.TIFF_TAG.TAG_COMPRESSION) { - if (tag.getUnsignedShort() == ExifTag.TIFF_TAG.COMPRESSION_JPEG) { + if (tag.getUnsignedShort(0) == ExifTag.TIFF_TAG.COMPRESSION_JPEG) { mIsContainCompressedImage = true; } } diff --git a/tests/src/com/android/gallery3d/exif/ExifReaderTest.java b/tests/src/com/android/gallery3d/exif/ExifReaderTest.java index 67e695682..e5b51f162 100644 --- a/tests/src/com/android/gallery3d/exif/ExifReaderTest.java +++ b/tests/src/com/android/gallery3d/exif/ExifReaderTest.java @@ -69,7 +69,7 @@ public class ExifReaderTest extends InstrumentationTestCase { private void checkThumbnail(ExifData exifData) { IfdData ifd1 = exifData.getIfdData(IfdId.TYPE_IFD_1); if (ifd1 != null) { - if (ifd1.getTag(ExifTag.TIFF_TAG.TAG_COMPRESSION).getUnsignedShort() == + if (ifd1.getTag(ExifTag.TIFF_TAG.TAG_COMPRESSION).getUnsignedShort(0) == ExifTag.TIFF_TAG.COMPRESSION_JPEG) { assertTrue(exifData.hasCompressedThumbnail()); byte[] thumbnail = exifData.getCompressedThumbnail(); @@ -79,7 +79,7 @@ public class ExifReaderTest extends InstrumentationTestCase { int planarType = ExifTag.TIFF_TAG.PLANAR_CONFIGURATION_CHUNKY; ExifTag planarTag = ifd1.getTag(ExifTag.TIFF_TAG.TAG_PLANAR_CONFIGURATION); if (planarTag != null) { - planarType = planarTag.getUnsignedShort(); + planarType = planarTag.getUnsignedShort(0); } ExifTag heightTag = ifd1.getTag(ExifTag.TIFF_TAG.TAG_IMAGE_HEIGHT); @@ -94,7 +94,7 @@ public class ExifReaderTest extends InstrumentationTestCase { assertTrue(stripCount == (imageLength + rowsPerStrip - 1) / rowsPerStrip); } else { ExifTag samplePerPixelTag = ifd1.getTag(ExifTag.TIFF_TAG.TAG_SAMPLES_PER_PIXEL); - int samplePerPixel = samplePerPixelTag.getUnsignedShort(); + int samplePerPixel = samplePerPixelTag.getUnsignedShort(0); assertTrue(stripCount == (imageLength + rowsPerStrip - 1) / rowsPerStrip * samplePerPixel); } @@ -114,9 +114,9 @@ public class ExifReaderTest extends InstrumentationTestCase { private int getUnsignedIntOrShort(ExifTag tag) { if (tag.getDataType() == ExifTag.TYPE_UNSIGNED_SHORT) { - return tag.getUnsignedShort(); + return tag.getUnsignedShort(0); } else { - return (int) tag.getUnsignedInt(); + return (int) tag.getUnsignedInt(0); } } -- cgit v1.2.3