coobird / thumbnailator

Thumbnailator - a thumbnail generation library for Java
MIT License
5.14k stars 784 forks source link

Unexpected alpha channel when using RGB colors and rotate #157

Closed ArheusLis closed 3 years ago

ArheusLis commented 3 years ago

Expected behavior

Output got rgb colors scheme.

Actual behavior

If I'm using rotation even with 0 - output become 32bit ARGB.

Steps to reproduce the behavior

        Thumbnails.of(new File("source_1.bmp"))
                .imageType(BufferedImage.TYPE_INT_RGB).scale(1).rotate(0).outputFormat("PNG")
                .toFile(new File("expect.png"));

Output: 32 bit ARGB

        Thumbnails.of(new File("source_1.bmp"))
                .imageType(BufferedImage.TYPE_INT_RGB).scale(1).outputFormat("PNG")
                .toFile(new File("expect.png"));

Output: 24 bit RGB

Environment

coobird commented 3 years ago

@ArheusLis , thank you for reporting this.

This behavior seems to be incorrect.

coobird commented 3 years ago

Fixed in 0.4.13.