Loading gallerycommon/src/com/android/gallery3d/exif/ExifInterface.java +9 −9 Original line number Diff line number Diff line Loading @@ -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. Loading Loading @@ -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}, Loading @@ -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; } Loading gallerycommon/src/com/android/gallery3d/exif/ExifTag.java +3 −6 Original line number Diff line number Diff line Loading @@ -17,7 +17,6 @@ package com.android.gallery3d.exif; import java.nio.charset.Charset; import java.text.SimpleDateFormat; import java.util.Arrays; import java.util.Date; Loading Loading @@ -102,8 +101,6 @@ public class ExifTag { // Value offset in exif header. private int mOffset; private static final SimpleDateFormat TIME_FORMAT = new SimpleDateFormat("yyyy:MM:dd kk:mm:ss"); /** * Returns true if the given IFD is a valid IFD. */ Loading Loading @@ -536,9 +533,9 @@ public class ExifTag { * @return true on success */ public boolean setTimeValue(long time) { // synchronized on TIME_FORMAT as SimpleDateFormat is not thread safe synchronized (TIME_FORMAT) { return setValue(TIME_FORMAT.format(new Date(time))); // synchronized on DATETIME_FORMAT as SimpleDateFormat is not thread safe synchronized (ExifInterface.DATETIME_FORMAT) { return setValue(ExifInterface.DATETIME_FORMAT.format(new Date(time))); } } Loading res/values/cm_strings.xml 0 → 100644 +20 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- Copyright (C) 2012-2014 The CyanogenMod 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. --> <resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <!-- Text indicating the time a media item was recorded in details window [CHAR LIMIT=14] --> <string name="record_time">Record time</string> </resources> No newline at end of file src/com/android/gallery3d/data/MediaDetails.java +18 −13 Original line number Diff line number Diff line Loading @@ -17,15 +17,11 @@ package com.android.gallery3d.data; import org.codeaurora.gallery.R; import com.android.gallery3d.common.Utils; import com.android.gallery3d.exif.ExifInterface; import com.android.gallery3d.exif.ExifTag; import com.android.gallery3d.exif.Rational; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; import java.util.HashMap; import java.util.Iterator; import java.util.Map.Entry; Loading @@ -50,15 +46,16 @@ public class MediaDetails implements Iterable<Entry<Integer, Object>> { public static final int INDEX_SIZE = 10; // for EXIF public static final int INDEX_MAKE = 100; public static final int INDEX_MODEL = 101; public static final int INDEX_FLASH = 102; public static final int INDEX_FOCAL_LENGTH = 103; public static final int INDEX_WHITE_BALANCE = 104; public static final int INDEX_APERTURE = 105; public static final int INDEX_SHUTTER_SPEED = 106; public static final int INDEX_EXPOSURE_TIME = 107; public static final int INDEX_ISO = 108; public static final int INDEX_DATETIME_ORIGINAL = 100; public static final int INDEX_MAKE = 101; public static final int INDEX_MODEL = 102; public static final int INDEX_FLASH = 103; public static final int INDEX_FOCAL_LENGTH = 104; public static final int INDEX_WHITE_BALANCE = 105; public static final int INDEX_APERTURE = 106; public static final int INDEX_SHUTTER_SPEED = 107; public static final int INDEX_EXPOSURE_TIME = 108; public static final int INDEX_ISO = 109; // Put this last because it may be long. public static final int INDEX_PATH = 200; Loading Loading @@ -148,6 +145,14 @@ public class MediaDetails implements Iterable<Entry<Integer, Object>> { MediaDetails.INDEX_WIDTH); setExifData(details, exif.getTag(ExifInterface.TAG_IMAGE_LENGTH), MediaDetails.INDEX_HEIGHT); ExifTag recordTag = exif.getTag(ExifInterface.TAG_DATE_TIME_ORIGINAL); if (recordTag == null) { recordTag = exif.getTag(ExifInterface.TAG_DATE_TIME_DIGITIZED); } if (recordTag == null) { recordTag = exif.getTag(ExifInterface.TAG_DATE_TIME); } setExifData(details, recordTag, MediaDetails.INDEX_DATETIME_ORIGINAL); setExifData(details, exif.getTag(ExifInterface.TAG_MAKE), MediaDetails.INDEX_MAKE); setExifData(details, exif.getTag(ExifInterface.TAG_MODEL), Loading src/com/android/gallery3d/ui/DetailsHelper.java +2 −0 Original line number Diff line number Diff line Loading @@ -139,6 +139,8 @@ public class DetailsHelper { return context.getString(R.string.exposure_time); case MediaDetails.INDEX_ISO: return context.getString(R.string.iso); case MediaDetails.INDEX_DATETIME_ORIGINAL: return context.getString(R.string.record_time); default: return "Unknown key" + key; } Loading Loading
gallerycommon/src/com/android/gallery3d/exif/ExifInterface.java +9 −9 Original line number Diff line number Diff line Loading @@ -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. Loading Loading @@ -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}, Loading @@ -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; } Loading
gallerycommon/src/com/android/gallery3d/exif/ExifTag.java +3 −6 Original line number Diff line number Diff line Loading @@ -17,7 +17,6 @@ package com.android.gallery3d.exif; import java.nio.charset.Charset; import java.text.SimpleDateFormat; import java.util.Arrays; import java.util.Date; Loading Loading @@ -102,8 +101,6 @@ public class ExifTag { // Value offset in exif header. private int mOffset; private static final SimpleDateFormat TIME_FORMAT = new SimpleDateFormat("yyyy:MM:dd kk:mm:ss"); /** * Returns true if the given IFD is a valid IFD. */ Loading Loading @@ -536,9 +533,9 @@ public class ExifTag { * @return true on success */ public boolean setTimeValue(long time) { // synchronized on TIME_FORMAT as SimpleDateFormat is not thread safe synchronized (TIME_FORMAT) { return setValue(TIME_FORMAT.format(new Date(time))); // synchronized on DATETIME_FORMAT as SimpleDateFormat is not thread safe synchronized (ExifInterface.DATETIME_FORMAT) { return setValue(ExifInterface.DATETIME_FORMAT.format(new Date(time))); } } Loading
res/values/cm_strings.xml 0 → 100644 +20 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- Copyright (C) 2012-2014 The CyanogenMod 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. --> <resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <!-- Text indicating the time a media item was recorded in details window [CHAR LIMIT=14] --> <string name="record_time">Record time</string> </resources> No newline at end of file
src/com/android/gallery3d/data/MediaDetails.java +18 −13 Original line number Diff line number Diff line Loading @@ -17,15 +17,11 @@ package com.android.gallery3d.data; import org.codeaurora.gallery.R; import com.android.gallery3d.common.Utils; import com.android.gallery3d.exif.ExifInterface; import com.android.gallery3d.exif.ExifTag; import com.android.gallery3d.exif.Rational; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; import java.util.HashMap; import java.util.Iterator; import java.util.Map.Entry; Loading @@ -50,15 +46,16 @@ public class MediaDetails implements Iterable<Entry<Integer, Object>> { public static final int INDEX_SIZE = 10; // for EXIF public static final int INDEX_MAKE = 100; public static final int INDEX_MODEL = 101; public static final int INDEX_FLASH = 102; public static final int INDEX_FOCAL_LENGTH = 103; public static final int INDEX_WHITE_BALANCE = 104; public static final int INDEX_APERTURE = 105; public static final int INDEX_SHUTTER_SPEED = 106; public static final int INDEX_EXPOSURE_TIME = 107; public static final int INDEX_ISO = 108; public static final int INDEX_DATETIME_ORIGINAL = 100; public static final int INDEX_MAKE = 101; public static final int INDEX_MODEL = 102; public static final int INDEX_FLASH = 103; public static final int INDEX_FOCAL_LENGTH = 104; public static final int INDEX_WHITE_BALANCE = 105; public static final int INDEX_APERTURE = 106; public static final int INDEX_SHUTTER_SPEED = 107; public static final int INDEX_EXPOSURE_TIME = 108; public static final int INDEX_ISO = 109; // Put this last because it may be long. public static final int INDEX_PATH = 200; Loading Loading @@ -148,6 +145,14 @@ public class MediaDetails implements Iterable<Entry<Integer, Object>> { MediaDetails.INDEX_WIDTH); setExifData(details, exif.getTag(ExifInterface.TAG_IMAGE_LENGTH), MediaDetails.INDEX_HEIGHT); ExifTag recordTag = exif.getTag(ExifInterface.TAG_DATE_TIME_ORIGINAL); if (recordTag == null) { recordTag = exif.getTag(ExifInterface.TAG_DATE_TIME_DIGITIZED); } if (recordTag == null) { recordTag = exif.getTag(ExifInterface.TAG_DATE_TIME); } setExifData(details, recordTag, MediaDetails.INDEX_DATETIME_ORIGINAL); setExifData(details, exif.getTag(ExifInterface.TAG_MAKE), MediaDetails.INDEX_MAKE); setExifData(details, exif.getTag(ExifInterface.TAG_MODEL), Loading
src/com/android/gallery3d/ui/DetailsHelper.java +2 −0 Original line number Diff line number Diff line Loading @@ -139,6 +139,8 @@ public class DetailsHelper { return context.getString(R.string.exposure_time); case MediaDetails.INDEX_ISO: return context.getString(R.string.iso); case MediaDetails.INDEX_DATETIME_ORIGINAL: return context.getString(R.string.record_time); default: return "Unknown key" + key; } Loading