summaryrefslogtreecommitdiffstats
path: root/gallerycommon
diff options
context:
space:
mode:
Diffstat (limited to 'gallerycommon')
-rw-r--r--gallerycommon/src/com/android/gallery3d/exif/ExifData.java4
-rw-r--r--gallerycommon/src/com/android/gallery3d/exif/ExifTag.java90
-rw-r--r--gallerycommon/src/com/android/gallery3d/exif/Util.java34
3 files changed, 5 insertions, 123 deletions
diff --git a/gallerycommon/src/com/android/gallery3d/exif/ExifData.java b/gallerycommon/src/com/android/gallery3d/exif/ExifData.java
index 7f79713..96ccb5b 100644
--- a/gallerycommon/src/com/android/gallery3d/exif/ExifData.java
+++ b/gallerycommon/src/com/android/gallery3d/exif/ExifData.java
@@ -127,7 +127,9 @@ public class ExifData {
}
for (int i = 0; i < IfdId.TYPE_IFD_COUNT; i++) {
- if (!Util.equals(data.getIfdData(i), getIfdData(i))) return false;
+ IfdData ifd1 = data.getIfdData(i);
+ IfdData ifd2 = getIfdData(i);
+ if ((ifd1 != ifd2) && (ifd1 != null && !ifd1.equals(ifd2))) return false;
}
return true;
}
diff --git a/gallerycommon/src/com/android/gallery3d/exif/ExifTag.java b/gallerycommon/src/com/android/gallery3d/exif/ExifTag.java
index 157a8db..d914f58 100644
--- a/gallerycommon/src/com/android/gallery3d/exif/ExifTag.java
+++ b/gallerycommon/src/com/android/gallery3d/exif/ExifTag.java
@@ -157,7 +157,7 @@ public class ExifTag {
public static final short TAG_GPS_DEST_DISTANCE = 26;
public static final short TAG_GPS_PROCESSING_METHOD = 27;
public static final short TAG_GPS_AREA_INFORMATION = 28;
- public static final short TAG_GPS_DATA_STAMP = 29;
+ public static final short TAG_GPS_DATE_STAMP = 29;
public static final short TAG_GPS_DIFFERENTIAL = 30;
// Interoperability tag
@@ -828,7 +828,7 @@ public class ExifTag {
(IfdId.TYPE_IFD_GPS << 24) | TYPE_UNDEFINED << 16 | SIZE_UNDEFINED);
sTagInfo.put(TAG_GPS_AREA_INFORMATION,
(IfdId.TYPE_IFD_GPS << 24) | TYPE_UNDEFINED << 16 | SIZE_UNDEFINED);
- sTagInfo.put(TAG_GPS_DATA_STAMP,
+ sTagInfo.put(TAG_GPS_DATE_STAMP,
(IfdId.TYPE_IFD_GPS << 24) | TYPE_ASCII << 16 | 11);
sTagInfo.put(TAG_GPS_DIFFERENTIAL,
(IfdId.TYPE_IFD_GPS << 24) | TYPE_UNSIGNED_SHORT << 16 | 11);
@@ -1398,92 +1398,6 @@ public class ExifTag {
(length > mComponentCount) ? mComponentCount : length);
}
- private String undefinedTypeValueToString() {
- StringBuilder sbuilder = new StringBuilder();
- byte buf[] = (byte[]) mValue;
- switch (mTagId) {
- case TAG_COMPONENTS_CONFIGURATION:
- for(int i = 0, n = getComponentCount(); i < n; i++) {
- if(i != 0) sbuilder.append(" ");
- sbuilder.append(buf[i]);
- }
- break;
- default:
- if (buf.length == 1) {
- sbuilder.append(buf[0]);
- } else {
- for (int i = 0, n = buf.length; i < n; i++) {
- byte code = buf[i];
- if (code == 0) continue;
- if (code > 31 && code < 127) {
- sbuilder.append((char) code);
- } else {
- sbuilder.append('.');
- }
- }
- }
- }
- return sbuilder.toString();
- }
-
- /**
- * Returns a string representation of the value of this tag.
- */
- String valueToString() {
- StringBuilder sbuilder = new StringBuilder();
- switch (getDataType()) {
- case ExifTag.TYPE_UNDEFINED:
- sbuilder.append(undefinedTypeValueToString());
- break;
- case ExifTag.TYPE_UNSIGNED_BYTE:
- byte buf[] = (byte[]) mValue;
- for(int i = 0, n = getComponentCount(); i < n; i++) {
- if(i != 0) sbuilder.append(" ");
- sbuilder.append(buf[i]);
- }
- break;
- case ExifTag.TYPE_ASCII:
- buf = (byte[]) mValue;
- for (int i = 0, n = buf.length; i < n; i++) {
- byte code = buf[i];
- if (code == 0) break;
- if (code > 31 && code < 127) {
- sbuilder.append((char) code);
- } else {
- sbuilder.append('.');
- }
- }
- break;
- case ExifTag.TYPE_UNSIGNED_LONG:
- for(int i = 0, n = getComponentCount(); i < n; i++) {
- if(i != 0) sbuilder.append(" ");
- sbuilder.append(getUnsignedLong(i));
- }
- break;
- case ExifTag.TYPE_RATIONAL:
- case ExifTag.TYPE_UNSIGNED_RATIONAL:
- for(int i = 0, n = getComponentCount(); i < n; i++) {
- Rational r = getRational(i);
- if(i != 0) sbuilder.append(" ");
- sbuilder.append(r.getNominator()).append("/").append(r.getDenominator());
- }
- break;
- case ExifTag.TYPE_UNSIGNED_SHORT:
- for(int i = 0, n = getComponentCount(); i < n; i++) {
- if(i != 0) sbuilder.append(" ");
- sbuilder.append(getUnsignedShort(i));
- }
- break;
- case ExifTag.TYPE_LONG:
- for(int i = 0, n = getComponentCount(); i < n; i++) {
- if(i != 0) sbuilder.append(" ");
- sbuilder.append(getLong(i));
- }
- break;
- }
- return sbuilder.toString();
- }
-
/**
* Returns true if the ID is one of the following: {@link #TAG_EXIF_IFD},
* {@link #TAG_GPS_IFD}, {@link #TAG_JPEG_INTERCHANGE_FORMAT},
diff --git a/gallerycommon/src/com/android/gallery3d/exif/Util.java b/gallerycommon/src/com/android/gallery3d/exif/Util.java
deleted file mode 100644
index 594d6fc..0000000
--- a/gallerycommon/src/com/android/gallery3d/exif/Util.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright (C) 2012 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.gallery3d.exif;
-
-import java.io.Closeable;
-
-class Util {
- public static boolean equals(Object a, Object b) {
- return (a == b) || (a == null ? false : a.equals(b));
- }
-
- public static void closeSilently(Closeable c) {
- if (c == null) return;
- try {
- c.close();
- } catch (Throwable t) {
- // do nothing
- }
- }
-}