Skip to content

Commit

Permalink
Add extra comments about data types
Browse files Browse the repository at this point in the history
  • Loading branch information
janhoy committed Oct 2, 2024
1 parent a1d96f9 commit 2cc413d
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,8 @@ private void readOrientationFromEXIF() {
// According to spec the orientation must be an unsigned short (16 bit)
// However, we have seen exif data in the wild with LONG and SLONG types
// Thus to be lenient we accept either and convert to int (github issue #548)
// It could also happen that 'value' is in fact a Java Integer even if the
// exif data type is LONG or SLONG, so we need to check for that as well.
if (value instanceof Long) {
orientation = Orientation.forEXIFOrientation(Math.toIntExact((long) value));
} else if (value instanceof Integer) {
Expand Down

0 comments on commit 2cc413d

Please sign in to comment.