Hello,
TwelveMonkeys version: 3.10.1
ImageUtil.createRotated() unexpectedly adds an alpha channel to the result image
when the source image does not have an alpha channel.
For example:
BufferedImage source = new BufferedImage(100, 50, BufferedImage.TYPE_INT_RGB);
assertEquals(100, source.getWidth());
assertEquals(50, source.getHeight());
assertFalse(source.getColorModel().hasAlpha());
BufferedImage result = ImageUtil.createRotated(source, 90);
assertEquals(50, result.getWidth());
assertEquals(100, result.getHeight());
assertFalse(result.getColorModel().hasAlpha()); // Unexpectedly fails
I noticed this after rotating a JPEG source image
then saving the result image as a JPEG
produces a IIOException: Bogus input colorspace
Obviously we can manually remove the alpha channel
after using ImageUtil.createRotated()
But it is suprising that an alpha channel has been added to the result image
after rotating a source image which does not have an alpha channel.
Thanks.
Hello,
TwelveMonkeys version:
3.10.1ImageUtil.createRotated()unexpectedly adds an alpha channel to the result imagewhen the source image does not have an alpha channel.
For example:
I noticed this after rotating a JPEG source image
then saving the result image as a JPEG
produces a
IIOException: Bogus input colorspaceObviously we can manually remove the alpha channel
after using
ImageUtil.createRotated()But it is suprising that an alpha channel has been added to the result image
after rotating a source image which does not have an alpha channel.
Thanks.