summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorEarl Ou <shunhsingou@google.com>2012-08-29 10:21:23 +0800
committerEarl Ou <shunhsingou@google.com>2012-08-30 14:50:10 +0800
commita393402c67ab65c322a1ce4c2f6714397591c363 (patch)
treefa13713c52f56f2a582406c79f4d4bf489ea0e96 /tests
parent650a9df4376e7c4f0b64d439b5d38dd81b7fcdcd (diff)
downloadandroid_packages_apps_Snap-a393402c67ab65c322a1ce4c2f6714397591c363.zip
android_packages_apps_Snap-a393402c67ab65c322a1ce4c2f6714397591c363.tar.gz
android_packages_apps_Snap-a393402c67ab65c322a1ce4c2f6714397591c363.tar.bz2
Redesign the set function of ExifTag
Change-Id: Iaf5632d759fe14c167cba54099b99719b31e3431
Diffstat (limited to 'tests')
-rw-r--r--tests/src/com/android/gallery3d/exif/ExifParserTest.java2
-rw-r--r--tests/src/com/android/gallery3d/exif/ExifReaderTest.java10
2 files changed, 6 insertions, 6 deletions
diff --git a/tests/src/com/android/gallery3d/exif/ExifParserTest.java b/tests/src/com/android/gallery3d/exif/ExifParserTest.java
index 241aaf5..e967e3d 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 67e6956..e5b51f1 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);
}
}