Open bright-tools opened 9 years ago
Investigation suggests that:
MediaStore.Images.Media.DATE_MODIFIED
to determine the timestamp at which an image was last modifiedDue to this, it seems that each time the image is processed by the MediaScanner, the date information is extracted from the EXIF and converted to Epoch time based on the current timezone. If the timezone has changed since the image being taken (or has shifted due to DST), this means that the calculated Epoch time will be different (e.g. the Epoch time of 13:01:01 on Jan 1st 2015 will be calculated differently for a phone set to GMT as compared to a phone set to CET).
The solution would seem to be to use the file's timestamp rather than the data from the MediaStore/EXIF.
Unfortunately getting the time from the filestamp doesn't work in a reliable way in the case that the SDcard is FAT formatted. FAT timestamps are interpreted as being in 'local time' (unless various mount options are used to change that, such as tz or time_offset). This means that rebooting the unit after the timezone has changed will result in the timestamp of all files on the SDcard seeming to change, referenced to the new timezone.
It was observed that after change to DST, photos were being re-uploaded due to the fact that the timestamp appeared to have changed by 1 hour.
e.g. originally uploaded file:
20150314_155612.jpg.1426348572.zip
file re-uploaded after DST change:
20150314_155612.jpg.1426344972.zip
The photos in question were stored on an external SD card.