Java base64位编码 转图片并进行裁剪
代码如下:
byte[] imageBytes = javax.xml.bind.DatatypeConverter.parseBase64Binary(imgContent);
BufferedImage bufferedImage = ImageIO.read(new ByteArrayInputStream(imageBytes));
final BufferedImage cropImage = ImageUtil.cropImage(bufferedImage, 250, 560, 350, 220);
ImageIO.write(cropImage, "png", new File("/Users/asher/TEMP/image-crop2.png"));