Changeset 13648 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2018-04-19T21:36:20+02:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/tools/ImageProvider.java
r13647 r13648 1656 1656 } 1657 1657 1658 ImageInputStream stream = ImageIO.createImageInputStream(input);1658 ImageInputStream stream = createImageInputStream(input); 1659 1659 if (stream == null) { 1660 1660 throw new IIOException("Can't create an ImageInputStream!"); … … 1706 1706 CheckParameterUtil.ensureParameterNotNull(input, "input"); 1707 1707 1708 ImageInputStream stream = ImageIO.createImageInputStream(input);1708 ImageInputStream stream = createImageInputStream(input); 1709 1709 BufferedImage bi = read(stream, readMetadata, enforceTransparency); 1710 1710 if (bi == null) { … … 1750 1750 1751 1751 try (InputStream istream = Utils.openStream(input)) { 1752 ImageInputStream stream = ImageIO.createImageInputStream(istream);1752 ImageInputStream stream = createImageInputStream(istream); 1753 1753 BufferedImage bi = read(stream, readMetadata, enforceTransparency); 1754 1754 if (bi == null) { … … 2016 2016 return buffImage; 2017 2017 } 2018 2019 private static ImageInputStream createImageInputStream(Object input) throws IOException { 2020 try { 2021 return ImageIO.createImageInputStream(input); 2022 } catch (SecurityException e) { 2023 if (ImageIO.getUseCache()) { 2024 ImageIO.setUseCache(false); 2025 return ImageIO.createImageInputStream(input); 2026 } 2027 throw new IOException(e); 2028 } 2029 } 2018 2030 }
Note:
See TracChangeset
for help on using the changeset viewer.