Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transparent background with incorrect file type #1083

Open
thomaskiesl opened this issue Jan 23, 2025 · 0 comments
Open

Transparent background with incorrect file type #1083

thomaskiesl opened this issue Jan 23, 2025 · 0 comments

Comments

@thomaskiesl
Copy link

Describe the bug
If png files/images with alpha channels (transparent background) are renamed from .png to .jpg the following exception comes up. Changing the file type to .png it was processed as expected.

javax.imageio.IIOException: Bogus input colorspace at java.desktop/com.sun.imageio.plugins.jpeg.JPEGImageWriter.writeImage(Native Method) at java.desktop/com.sun.imageio.plugins.jpeg.JPEGImageWriter.writeOnThread(JPEGImageWriter.java:1035) at java.desktop/com.sun.imageio.plugins.jpeg.JPEGImageWriter.write(JPEGImageWriter.java:385) at com.twelvemonkeys.imageio.plugins.jpeg.JPEGImageWriter.write(JPEGImageWriter.java:175) at java.desktop/javax.imageio.ImageWriter.write(ImageWriter.java:613) at java.desktop/javax.imageio.ImageIO.doWrite(ImageIO.java:1632) at java.desktop/javax.imageio.ImageIO.write(ImageIO.java:1558)

It happens on production, because someone tried to upload such a file. Maybe there is an easy way to fix this.

Version information
1The version of the TwelveMonkeys ImageIO library in use.
3.12.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant