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
I agree that this is kind of surprising from an API standpoint. 😀
However, the code explicitly creates an image with transparencey in ImageUtil line 725... So not that surprising... I guess one could add a quick fix for this, by testing the fast flag (which basically tells if this is a quadrant rotation or not), and create a non-transparent image (possibly of the exact same type) in the fast case. I believe we only need transparency in the non-fast cases.
Feel free to provide a PR for this, and add the test case above to verify the (new and improved) correct behavior!
PS: I wrote this code quite a long time ago, and it was written mainly for quick and easy UI operations... It may not be sufficient for more advanced image processing with high pixel depth or other fancy features. 😬
Hello,
TwelveMonkeys version:
3.10.1
ImageUtil.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 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.
The text was updated successfully, but these errors were encountered: