Changeset 16318 in josm


Ignore:
Timestamp:
2020-04-17T11:41:56+02:00 (5 years ago)
Author:
GerdP
Message:

see #19097: Windows plays alarm sound when opening preset preferences
Avoid to show lots of garbarge on the console when url starts with "data:image/svg+xml" but contains a PNG file
The alarm sound is played when 0x07 is written to the console.

File:
1 edited

Legend:

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

    r16060 r16318  
    6565import javax.xml.parsers.ParserConfigurationException;
    6666
    67 import com.kitfox.svg.SVGDiagram;
    68 import com.kitfox.svg.SVGException;
    69 import com.kitfox.svg.SVGUniverse;
    7067import org.openstreetmap.josm.data.Preferences;
    7168import org.openstreetmap.josm.data.osm.DataSet;
     
    9087import org.xml.sax.XMLReader;
    9188import org.xml.sax.helpers.DefaultHandler;
     89
     90import com.kitfox.svg.SVGDiagram;
     91import com.kitfox.svg.SVGException;
     92import com.kitfox.svg.SVGUniverse;
    9293
    9394/**
     
    10171018            if ("image/svg+xml".equals(mediatype)) {
    10181019                String s = new String(bytes, StandardCharsets.UTF_8);
     1020                // see #19097: check if s starts with PNG magic
     1021                if (s.length() > 4 && "PNG".equals(s.substring(1, 4))) {
     1022                    Logging.warn("url contains PNG file " + url);
     1023                    return null;
     1024                }
    10191025                SVGDiagram svg;
    10201026                synchronized (getSvgUniverse()) {
Note: See TracChangeset for help on using the changeset viewer.