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

Require explicitly setting image type when outputting to BufferedImage(s) #192

Open
coobird opened this issue Mar 26, 2022 · 0 comments
Open

Comments

@coobird
Copy link
Owner

coobird commented Mar 26, 2022

Currently, Thumbnailator does not require setting the BufferedImage type and will (attempt to) use the types as the input source. (More specifically, the image type that is used by the Image I/O ImageReader implementation used for the image.) This means that the type can differ depending on the image type or the image itself.

By requiring the output type to be a certain type, the inconsistencies can be eliminated and also could avoid issues like "wrong colors in JPEG" issue that stems from handing a BufferedImage with an alpha channel to the default JPEG writer shipped with Java.

Also consider limiting the use of imageType method to only use with methods that output BufferedImage(s) like asBufferedImage.

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