Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[imageio] Allow out of spec DateTimeOriginal without trailing null byte #18169

Merged
merged 1 commit into from
Jan 6, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/common/exif.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1138,9 +1138,12 @@ static void _find_datetime_taken(Exiv2::ExifData &exifData,
// Note: We allow a longer "datetime original" field with an unnecessary
// trailing byte(s) due to buggy software that creates it.
// See https://github.com/darktable-org/darktable/issues/17389
// We also accept the out of spec Exif.Photo.DateTimeOriginal
// without a null terminator, which AnalogExif creates.
// See https://github.com/darktable-org/darktable/issues/18146
if((FIND_EXIF_TAG("Exif.Image.DateTimeOriginal")
|| FIND_EXIF_TAG("Exif.Photo.DateTimeOriginal"))
&& pos->size() >= DT_DATETIME_EXIF_LENGTH)
&& pos->size() >= DT_DATETIME_EXIF_LENGTH - 1)
{
_strlcpy_to_utf8(exif_datetime_taken, DT_DATETIME_EXIF_LENGTH, pos, exifData);
if(FIND_EXIF_TAG("Exif.Photo.SubSecTimeOriginal")
Expand Down
Loading