set an option for the java-internal image parser that prevents that the image is cached using the file-system in a temporary file. This should speed up image parsing during image indexing dramatically and should also cause better performance when showing the yacy banner and OSM tiles.

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@6772 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
orbiter 15 years ago
parent 312ca5d917
commit 9ddb8e4a43

@ -105,6 +105,7 @@ public class Banner {
}
if (!NetworkGraph.logoIsLoaded()) {
ImageIO.setUseCache(false); // do not write a cache to disc; keep in RAM
final BufferedImage logo = ImageIO.read(new File(IMAGE));
return NetworkGraph.getBannerPicture(1000, width, height, bgcolor, textcolor, bordercolor, name, links, words, type, myppm, network, peers, nlinks, nwords, nqph, nppm, logo);
}

@ -99,6 +99,7 @@ public class OSMTile {
if (entry == null) return null;
}
try {
ImageIO.setUseCache(false); // do not write a cache to disc; keep in RAM
return ImageIO.read(new ByteArrayInputStream(tileb));
} catch (final EOFException e) {
return null;

@ -207,6 +207,7 @@ public class genericImageParser extends AbstractParser implements Idiom {
final InputStream sourceStream) throws ParserException {
BufferedImage image = null;
try {
ImageIO.setUseCache(false); // do not write a cache to disc; keep in RAM
image = ImageIO.read(sourceStream);
} catch (final EOFException e) {
Log.logException(e);

Loading…
Cancel
Save