Changeset 7495 in josm
- Timestamp:
- 2014-09-05T00:14:59+02:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/tools/ImageProvider.java
r7402 r7495 680 680 BufferedImage img = null; 681 681 try { 682 img = read(path, false, false); 682 // See #10479: for PNG files, always enforce transparency to be sure tNRS chunk is used even not in paletted mode 683 // This can be removed if someday Oracle fixes https://bugs.openjdk.java.net/browse/JDK-6788458 684 // hg.openjdk.java.net/jdk7u/jdk7u/jdk/file/828c4fedd29f/src/share/classes/com/sun/imageio/plugins/png/PNGImageReader.java#l656 685 img = read(path, false, true); 686 if (Main.isDebugEnabled() && isTransparencyForced(img)) { 687 Main.debug("Transparency has been forced for image "+path.toExternalForm()); 688 } 683 689 } catch (IOException e) { 684 690 Main.warn(e); … … 1240 1246 bi = new BufferedImage(bi.getColorModel(), bi.getRaster(), bi.isAlphaPremultiplied(), properties); 1241 1247 if (enforceTransparency) { 1242 if (Main.is DebugEnabled()) {1243 Main. debug("Enforcing image transparency of "+stream+" for "+color);1248 if (Main.isTraceEnabled()) { 1249 Main.trace("Enforcing image transparency of "+stream+" for "+color); 1244 1250 } 1245 1251 bi = makeImageTransparent(bi, color); … … 1320 1326 public static BufferedImage makeImageTransparent(BufferedImage bi, Color color) { 1321 1327 // the color we are looking for. Alpha bits are set to opaque 1322 final int markerRGB = color.getRGB() | 0xFF FFFFFF;1328 final int markerRGB = color.getRGB() | 0xFF000000; 1323 1329 ImageFilter filter = new RGBImageFilter() { 1324 1330 @Override
Note:
See TracChangeset
for help on using the changeset viewer.