Closed artichikin closed 2 years ago
I think i have a similar problem, the exif orientation is handled properly but the resulting image has black background. I should also note that i use:
crop(Positions.CENTER)
same issue here as artichikin. size(x, y) is applied on the image before its rotated according to EXIF information, leading to a thumbnail that is to small to fit the (x,y) box.
Kind of a hack, but to get around this, if the Orientation is not TOP_LEFT or BOTTOM_RIGHT, just swap your width/height parameters. Then it will crop wrong and rotate it back to the right place.
I'll look into this as a candidate to include in an upcoming release.
@coobird same issue
Thumbnails.of(bufferedImage).scale(scale).asBufferedImage();
This issue has been fixed in 0.4.18.
I need to make thumbnails from photos and I don't know in advance if they need rotation or not:
The problem here is if I provide a non-rotated image, it sizes it correctly, and a side-ways oriented image gets scaled to 210 x 280, so it seems like it's calculating the max width and height based on the original dimensions instead of the rotated dimensions?