diff options
| author | Flamefire <alex@grundis.de> | 2014-09-17 02:40:04 +0200 |
|---|---|---|
| committer | LorDClockaN <davor@losinj.com> | 2014-10-21 14:17:21 +0200 |
| commit | 52f8d71045dd2e2a6ba743cfe14e6b44af0928c7 (patch) | |
| tree | d74c00904071d6107932f3e298bee12b183a1e01 /gallerycommon/src/com/android/gallery3d/exif/ExifInterface.java | |
| parent | 6cbb45522cad05f1638d7a3f138cc65f9fb1cc30 (diff) | |
PS2: Move strings
PS3: Move DateTime format to public in ExifInterface
PS4: Actually use that DateTime format
Change-Id: If30e19d0b79039357f393752544c655e073a46d2
Diffstat (limited to 'gallerycommon/src/com/android/gallery3d/exif/ExifInterface.java')
| -rw-r--r-- | gallerycommon/src/com/android/gallery3d/exif/ExifInterface.java | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/gallerycommon/src/com/android/gallery3d/exif/ExifInterface.java b/gallerycommon/src/com/android/gallery3d/exif/ExifInterface.java index a1cf0fc8..4310c6ba 100644 --- a/gallerycommon/src/com/android/gallery3d/exif/ExifInterface.java +++ b/gallerycommon/src/com/android/gallery3d/exif/ExifInterface.java @@ -318,6 +318,13 @@ public class ExifInterface { public static final int TAG_INTEROPERABILITY_INDEX = defineTag(IfdId.TYPE_IFD_INTEROPERABILITY, (short) 1); + private static final String GPS_DATE_FORMAT_STR = "yyyy:MM:dd"; + private static final String DATETIME_FORMAT_STR = "yyyy:MM:dd kk:mm:ss"; + public static final DateFormat DATETIME_FORMAT = new SimpleDateFormat(DATETIME_FORMAT_STR); + private final DateFormat mGPSDateStampFormat = new SimpleDateFormat(GPS_DATE_FORMAT_STR); + private final Calendar mGPSTimeStampCalendar = Calendar + .getInstance(TimeZone.getTimeZone("UTC")); + /** * Tags that contain offset markers. These are included in the banned * defines. @@ -1944,13 +1951,6 @@ public class ExifInterface { return latLon; } - private static final String GPS_DATE_FORMAT_STR = "yyyy:MM:dd"; - private static final String DATETIME_FORMAT_STR = "yyyy:MM:dd kk:mm:ss"; - private final DateFormat mDateTimeStampFormat = new SimpleDateFormat(DATETIME_FORMAT_STR); - private final DateFormat mGPSDateStampFormat = new SimpleDateFormat(GPS_DATE_FORMAT_STR); - private final Calendar mGPSTimeStampCalendar = Calendar - .getInstance(TimeZone.getTimeZone("UTC")); - /** * Creates, formats, and sets the DateTimeStamp tag for one of: * {@link #TAG_DATE_TIME}, {@link #TAG_DATE_TIME_DIGITIZED}, @@ -1964,8 +1964,8 @@ public class ExifInterface { public boolean addDateTimeStampTag(int tagId, long timestamp, TimeZone timezone) { if (tagId == TAG_DATE_TIME || tagId == TAG_DATE_TIME_DIGITIZED || tagId == TAG_DATE_TIME_ORIGINAL) { - mDateTimeStampFormat.setTimeZone(timezone); - ExifTag t = buildTag(tagId, mDateTimeStampFormat.format(timestamp)); + DATETIME_FORMAT.setTimeZone(timezone); + ExifTag t = buildTag(tagId, DATETIME_FORMAT.format(timestamp)); if (t == null) { return false; } |
