-
Notifications
You must be signed in to change notification settings - Fork 70
Open
Description
final boolean isBMP = "bmp".equalsIgnoreCase(imageFormat);
final BufferedImage bufferedImage = getBufferedImage(isBMP ? BufferedImage.TYPE_INT_RGB : BufferedImage.TYPE_INT_ARGB);Using the above code to convert jpg images, it looks like the image will turn red. Can I change it to the following code?
BufferedImage bufferedImage = this.getBufferedImage(getImageType(imageFormat));
private int getImageType(String imageFormat){
if ("jpg".equalsIgnoreCase(imageFormat)){
return BufferedImage.TYPE_3BYTE_BGR;
}
if ("bmp".equalsIgnoreCase(imageFormat)){
return BufferedImage.TYPE_INT_RGB;
}
return BufferedImage.BITMASK;
}Metadata
Metadata
Assignees
Labels
No labels