- Timestamp:
- 2012-02-15T18:39:05+01:00 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/tools/ImageProvider.java
r4893 r4938 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; … … 51 52 import org.xml.sax.helpers.DefaultHandler; 52 53 import org.xml.sax.helpers.XMLReaderFactory; 54 53 55 import com.kitfox.svg.SVGDiagram; 54 56 import com.kitfox.svg.SVGException; … … 400 402 return svg == null ? null : new ImageResource(svg); 401 403 case OTHER: 402 Image img = Toolkit.getDefaultToolkit().createImage(is.getFile().toURI().toURL()); 403 return img == null ? null : new ImageResource(img, false); 404 BufferedImage img = null; 405 try { 406 img = ImageIO.read(is.getFile().toURI().toURL()); 407 } catch (IOException e) {} 408 return img == null ? null : new ImageResource(img, true); 404 409 default: 405 410 throw new AssertionError(); … … 466 471 size -= l; 467 472 } 468 Image img = Toolkit.getDefaultToolkit().createImage(buf); 473 BufferedImage img = null; 474 try { 475 img = ImageIO.read(new ByteArrayInputStream(buf)); 476 } catch (IOException e) {} 469 477 return img == null ? null : new ImageResource(img, false); 470 478 default: … … 497 505 return svg == null ? null : new ImageResource(svg); 498 506 case OTHER: 499 Image img = Toolkit.getDefaultToolkit().createImage(path); 500 return img == null ? null : new ImageResource(img, false); 507 BufferedImage img = null; 508 try { 509 img = ImageIO.read(path); 510 } catch (IOException e) {} 511 return img == null ? null : new ImageResource(img, true); 501 512 default: 502 513 throw new AssertionError();
Note:
See TracChangeset
for help on using the changeset viewer.