From 316440a4e0fe5c698de879ebd98f442e22393db6 Mon Sep 17 00:00:00 2001 From: Mike Primm Date: Fri, 26 Aug 2011 03:48:42 +0800 Subject: [PATCH] Disable IOImage cache use for image loads --- src/main/java/org/dynmap/hdmap/TexturePack.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/org/dynmap/hdmap/TexturePack.java b/src/main/java/org/dynmap/hdmap/TexturePack.java index 63f7953c..d87c4230 100644 --- a/src/main/java/org/dynmap/hdmap/TexturePack.java +++ b/src/main/java/org/dynmap/hdmap/TexturePack.java @@ -369,6 +369,7 @@ public class TexturePack { private void loadTerrainPNG(InputStream is) throws IOException { int i, j; /* Load image */ + ImageIO.setUseCache(false); BufferedImage img = ImageIO.read(is); if(img == null) { throw new FileNotFoundException(); } terrain_width = img.getWidth(); @@ -429,6 +430,7 @@ public class TexturePack { /* Load image into image array */ private void loadImage(InputStream is, int idx) throws IOException { /* Load image */ + ImageIO.setUseCache(false); BufferedImage img = ImageIO.read(is); if(img == null) { throw new FileNotFoundException(); } imgs[idx] = new LoadedImage(); @@ -642,6 +644,7 @@ public class TexturePack { } } BufferedImage img = DynmapBufferedImage.createBufferedImage(outbuf, terrain_width, terrain_height); + ImageIO.setUseCache(false); ImageIO.write(img, "png", f); }