Closed zhouxiangdev closed 4 years ago
Sorry for the late response. This appears to be a duplicate of #41.
You could try the workaround mentioned in https://github.com/coobird/thumbnailator/issues/41#issuecomment-330456553 -- basically add .imageType(BufferedImage.TYPE_INT_ARGB)
to force Thumbnailator to process with transparencies enabled.
Hope this helps.
Expected behavior
Please describe what you are expecting the library to perform. I want to generate the thumbnail of one PNG file
Actual behavior
Please describe the actual behavior you are experiencing, including stack trace and other information which would help diagnose the issue. The source png file is this: The generated thumbnail is this:
The color is wrong, it is supposed to be red.
Steps to reproduce the behavior
Please enter step-by-step instructions for reproducing the actual behavior. Including code can be helpful in diagnosing issue, but please keep the code to a minimal that will reproduce the behavior. I checked the PNG file: (1200x628, 4-bit palette, non-interlaced, 98.5%). I think it is due to 4-bit palette which is not supported. After I convert to PNG-8 or PNG-24, no issue.
Environment
Please provide vendor and version information for the Operating System, JDK, and Thumbnailator. Please feel free to add any other information which may be pertinent.