* @throws IOException
*/
public final BufferedImage toBufferedImage(byte[] bytes,String format) throws IOException {
if(StringUtil.isEmpty(format))format=ImageUtil.getFormat(bytes,null);
if("psd".equalsIgnoreCase(format)) {
PSDReader reader = new PSDReader();
reader.read(new ByteArrayInputStream(bytes));
return reader.getImage();
}
if(JAIUtil.isSupportedReadFormat(format)){
return JAIUtil.read(new ByteArrayInputStream(bytes),format);
}
BufferedImage img = ImageIO.read(new ByteArrayInputStream(bytes));