Changeset 13823 in josm
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/tools/ImageProvider.java
r13737 r13823 1778 1778 * @param enforceTransparency if {@code true}, makes sure to read image metadata and, if the image does not 1779 1779 * 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. 1781 1781 * 1782 1782 * @return a <code>BufferedImage</code> containing the decoded … … 1801 1801 try { 1802 1802 bi = reader.read(0, param); 1803 if (bi.getTransparency() != Transparency.TRANSLUCENT && (readMetadata || enforceTransparency) ) {1803 if (bi.getTransparency() != Transparency.TRANSLUCENT && (readMetadata || enforceTransparency) && Utils.getJavaVersion() < 11) { 1804 1804 Color color = getTransparentColor(bi.getColorModel(), reader); 1805 1805 if (color != null) { -
trunk/test/unit/org/openstreetmap/josm/tools/ImageProviderTest.java
r11526 r13823 64 64 assertEquals(Transparency.TRANSLUCENT, ImageProvider.read(file, true, true).getTransparency()); 65 65 assertEquals(Transparency.TRANSLUCENT, ImageProvider.read(file, false, true).getTransparency()); 66 assertEquals(Transparency.OPAQUE, ImageProvider.read(file, false, false).getTransparency()); 67 assertEquals(Transparency.OPAQUE, ImageProvider.read(file, true, false).getTransparency()); 66 long expectedTransparency = Utils.getJavaVersion() < 11 ? Transparency.OPAQUE : Transparency.TRANSLUCENT; 67 assertEquals(expectedTransparency, ImageProvider.read(file, false, false).getTransparency()); 68 assertEquals(expectedTransparency, ImageProvider.read(file, true, false).getTransparency()); 68 69 } 69 70
Note:
See TracChangeset
for help on using the changeset viewer.