Changeset 18567 in josm for trunk/src/org


Ignore:
Timestamp:
2022-10-04T23:28:06+02:00 (2 years ago)
Author:
taylor.smock
Message:

Fix #22391: Support "image/png; mode=8bit" imagery

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/imagery/WMTSTileSource.java

    r18371 r18567  
    550550        supportedMimeTypes.add("image/jpgpng");         // used by ESRI
    551551        supportedMimeTypes.add("image/png8");           // used by geoserver
     552        supportedMimeTypes.add("image/png; mode=8bit"); // used by MapServer
    552553        if (supportedMimeTypes.contains("image/jpeg")) {
    553554            supportedMimeTypes.add("image/jpg"); // sometimes misspelled by Arcgis
     
    607608        if (layer.format == null) {
    608609            // no format found - it's mandatory parameter - can't use this layer
    609             Logging.warn(tr("Can''t use layer {0} because no supported formats where found. Layer is available in formats: {1}",
     610            Logging.warn(tr("Can''t use layer {0} because no supported formats were found. Layer is available in formats: {1}",
    610611                    layer.getUserTitle(),
    611612                    String.join(", ", unsupportedFormats)));
    612613            return null;
     614        }
     615        // Java has issues if spaces are not URL encoded. Ensure that we URL encode the spaces.
     616        if (layer.format.contains(" ")) {
     617            layer.format = layer.format.replace(" ", "&20");
    613618        }
    614619        return layer;
Note: See TracChangeset for help on using the changeset viewer.