mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
修复Graphics2D的资源没释放问题
This commit is contained in:
@@ -1338,8 +1338,11 @@ public class ImgUtil {
|
||||
final BufferedImage bimage = new BufferedImage(
|
||||
img.getWidth(null), img.getHeight(null), imageType);
|
||||
final Graphics2D bGr = GraphicsUtil.createGraphics(bimage, backgroundColor);
|
||||
bGr.drawImage(img, 0, 0, null);
|
||||
bGr.dispose();
|
||||
try{
|
||||
bGr.drawImage(img, 0, 0, null);
|
||||
} finally {
|
||||
bGr.dispose();
|
||||
}
|
||||
|
||||
return bimage;
|
||||
}
|
||||
|
Reference in New Issue
Block a user