Skip to content

fix: editing outside the app and saving to gallery, the timestamp of the photo was in UTC#8

Merged
alexgerardojacinto merged 3 commits intofeat/RMET-4099/android-implementationfrom
feat/RMET-5076/fix-utc-save-to-gallery
Mar 20, 2026
Merged

fix: editing outside the app and saving to gallery, the timestamp of the photo was in UTC#8
alexgerardojacinto merged 3 commits intofeat/RMET-4099/android-implementationfrom
feat/RMET-5076/fix-utc-save-to-gallery

Conversation

@alexgerardojacinto
Copy link
Contributor

Fix issue where when editing outside the app and saving to gallery, the timestamp of the photo was in UTC

Comment on lines +210 to +222
if (outFile == null) {
return
}
// Format datetime as EXIF expects: "yyyy:MM:dd HH:mm:ss"
val currentDateTime = SimpleDateFormat(
"yyyy:MM:dd HH:mm:ss",
Locale.getDefault()
).format(Date())

outFile!!.setAttribute(ExifInterface.TAG_DATETIME, currentDateTime)
outFile!!.setAttribute(ExifInterface.TAG_DATETIME_ORIGINAL, currentDateTime)
outFile!!.setAttribute(ExifInterface.TAG_DATETIME_DIGITIZED, currentDateTime)
outFile!!.saveAttributes()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't hurt to wrap this in a ?.let or do ?.set/save.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, Claude autogenerated that 😅 I'll refactor

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated if you want to check again

Copy link
Collaborator

@OS-ruimoreiramendes OS-ruimoreiramendes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested by changing the device time zone, the date/time saved to the gallery is working as expected based on the selected time zone.

@alexgerardojacinto alexgerardojacinto merged commit ade68a1 into feat/RMET-4099/android-implementation Mar 20, 2026
2 checks passed
@OS-pedrogustavobilro OS-pedrogustavobilro deleted the feat/RMET-5076/fix-utc-save-to-gallery branch March 20, 2026 20:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants