I researched and tried many options to try to get this to work, but I don't get it with it unfortunately.
What I'm trying to do is set the Date Taken tag (Tag_DateTime) to JPEG Exif data from an Android application. I already have working code to set the Latitude and Longitute tags, but I can’t get the Date tag to install for life.
Here is the code:
SimpleDateFormat fmt_Exif = new SimpleDateFormat("yyyy:MM:dd HH:mm:ss");
try {
ExifInterface exif = new ExifInterface(filePhoto.getPath());
// Set and save the GPS and time data
exif.setAttribute(ExifInterface.TAG_GPS_LATITUDE, strLat);
exif.setAttribute(ExifInterface.TAG_GPS_LONGITUDE, strLong);
exif.setAttribute(ExifInterface.TAG_DATETIME, fmt_Exif.format(locLatestLocation.getTime()));
exif.saveAttributes();
} catch (IOException e) {
e.printStackTrace();
}
- locLatestLocation - The location is used to get the time in milliseconds.
- fmt_Exif - SimpleDateFormat is used to format millisecond time in the correct format for the TAG_DateTime Exif tag.
- strLat and strLong are filled elsewhere in the correct format to set latitude and longitude tags.
- , , .
, , jpeg Date Taken, , , , .
, Sanselan , - , .
- , , ?