Skip to content

Commit

Permalink
handle exif errors
Browse files Browse the repository at this point in the history
  • Loading branch information
jstkdng committed Feb 25, 2024
1 parent f61c473 commit 886d8e7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/util/util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -244,8 +244,11 @@ auto util::read_exif_rotation(const char *path) -> std::optional<std::uint16_t>
return {};
}
// orientation is in IFD[0]
auto *ifd = data->ifd[0];
auto *ifd = data->ifd[EXIF_IFD_0];
const auto *entry = exif_content_get_entry(ifd, EXIF_TAG_ORIENTATION);
if (entry == nullptr) {
return {};
}
return entry->data[1];
}

Expand Down

0 comments on commit 886d8e7

Please sign in to comment.