Ignore:
Timestamp:
2018-05-23T20:22:13+02:00 (17 months ago)
Author:
Don-vip
Message:

see #9984, see #16047 - Java 11 handles transparent PNG out of the box, disable JOSM mechanisms to force transparency on this version

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/tools/ImageProvider.java

    r13737 r13823  
    17781778     * @param enforceTransparency if {@code true}, makes sure to read image metadata and, if the image does not
    17791779     * provide an alpha channel but defines a {@code TransparentColor} metadata node, that the resulting image
    1780      * has a transparency set to {@code TRANSLUCENT} and uses the correct transparent color.
     1780     * has a transparency set to {@code TRANSLUCENT} and uses the correct transparent color. For Java < 11 only.
    17811781     *
    17821782     * @return a <code>BufferedImage</code> containing the decoded
     
    18011801        try {
    18021802            bi = reader.read(0, param);
    1803             if (bi.getTransparency() != Transparency.TRANSLUCENT && (readMetadata || enforceTransparency)) {
     1803            if (bi.getTransparency() != Transparency.TRANSLUCENT && (readMetadata || enforceTransparency) && Utils.getJavaVersion() < 11) {
    18041804                Color color = getTransparentColor(bi.getColorModel(), reader);
    18051805                if (color != null) {
Note: See TracChangeset for help on using the changeset viewer.