Closed KamilKrol closed 4 years ago
Exif is metadata contained in image streams that support including Exif metadata. A BufferedImage
is an Java class which is essentially a buffer containing image data. BufferedImage
is not a image format but rather a container for handling image data in Java, and does not include Exif metadata.
Since BufferedImage
does not include Exif data, it is not possible to use it to determine orientation of a BufferedImage
since it doesn't exist. Basically, the moment you read the image stream to a BufferedImage
the Exif metadata is lost. Therefore, this behavior is expected.
Expected behavior
When setting
useExifOrientation
flag totrue
, one can expect that Image orientation is handled properly no matter what Image source we use (InputStream, BufferedImage etc.).Actual behavior
Image orientation from EXIF metadata is respected in other cases. After checking the source code it seems that:
Steps to reproduce the behavior
Test cases reproducing the issue: https://github.com/KamilKrol/thumbnailator/commit/d839bb977c2102637db121ce5401d077c7689266 For the moment we have implemented workaround in our application, but we need to implement proper solution - ideally by providing Pull request to this library.
Environment
Should be reproducible on any environment (implementation problem).