.setDestDir(new File(Main.pref.getCacheDirectory(), "images").getPath());
try (InputStream is = cf.getInputStream()) {
switch (type) {
case SVG:
URI uri = getSvgUniverse().loadSVG(is, Utils.fileToURL(cf.getFile()).toString());
SVGDiagram svg = getSvgUniverse().getDiagram(uri);
return svg == null ? null : new ImageResource(svg);
case OTHER:
BufferedImage img = null;
try {
img = read(Utils.fileToURL(cf.getFile()), false, false);