Ticket #1576: use_imgio.patch
File use_imgio.patch, 1.1 KB (added by , 13 years ago) |
---|
-
src/org/openstreetmap/josm/tools/ImageProvider.java
35 35 import java.util.zip.ZipEntry; 36 36 import java.util.zip.ZipFile; 37 37 38 import javax.imageio.ImageIO; 38 39 import javax.swing.Icon; 39 40 import javax.swing.ImageIcon; 40 41 … … 496 497 SVGDiagram svg = getSvgUniverse().getDiagram(uri); 497 498 return svg == null ? null : new ImageResource(svg); 498 499 case OTHER: 499 Image img = Toolkit.getDefaultToolkit().createImage(path); 500 return img == null ? null : new ImageResource(img, false); 500 BufferedImage img = null; 501 try { 502 img = ImageIO.read(path); 503 } catch (IOException e) {} 504 return img == null ? null : new ImageResource(img, true); 501 505 default: 502 506 throw new AssertionError(); 503 507 }