You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In our handling of EXIF orientations we
were too smart. We would take the EXIF
orientation as tagged in the file, and
we would subtract 1 from it, so that we
could then fetch a corresponding symbol
from our enum-ish array of orientations.
There is however an EXIF orientation called
"Unknown", which occupies the enum value
of 0 - we would take that value and subtract -1
from it. This would in turn make us pick
orientation 8, which was not the correct one
and would indicate that the image is rotated
while in fact it is not.
To mitigate, we replace the array enum
with a Hash - so that it becomes impossible
to rollover the enum index when it becomes
negative, and simplify the rotated orientation
detection.
0 commit comments