Ignore:
Timestamp:
2022-08-23T20:06:58+02:00 (2 years ago)
Author:
taylor.smock
Message:

Fix #22303: Open drone image as background image

  • Add additional files to be merged in META-INF for JAI (this fixes an issue where ShadedRelief could not be found). This is done by modifying build.xml to concat multiple files with the same path and name in different jar files together
  • Add CompressorSpi and DecompressorSpi so that compressed image formats can be read. This requires us to call CompressionRegistry#registerApplicationClasspathSpis with the geotools plugin classloader.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/geotools/src/org/openstreetmap/josm/plugins/geotools/GeoToolsPlugin.java

    r34097 r36015  
    1212import javax.media.jai.OperationRegistry;
    1313
     14import it.geosolutions.imageio.compression.CompressionRegistry;
    1415import org.geotools.image.ImageWorker;
    1516import org.geotools.referencing.CRS;
     
    3839    }
    3940
    40     private void initJAI() {
     41    private static void initJAI() {
    4142        // Disable mediaLib searching that produces unwanted errors
    4243        // See https://www.java.net/node/666373
     
    5051        // As the JAI jars are bundled in the geotools plugin, JAI initialization does not work,
    5152        // so we need to perform the tasks described here ("Initialization and automatic loading of registry objects"):
    52         // https://docs.oracle.com//cd/E17802_01/products/products/java-media/jai/forDevelopers/jai-apidocs/javax/media/jai/OperationRegistry.html
     53        // https://docs.oracle.com/cd/E17802_01/products/products/java-media/jai/forDevelopers/jai-apidocs/javax/media/jai/OperationRegistry.html
    5354        OperationRegistry registry = JAI.getDefaultInstance().getOperationRegistry();
    5455        if (registry == null) {
     
    9293    }
    9394
    94     private void initGeoTools() {
     95    private static void initGeoTools() {
    9596        // Force Axis order. Fix #8248
    9697        // See http://docs.geotools.org/stable/userguide/library/referencing/order.html
    9798        System.setProperty("org.geotools.referencing.forceXY", "true");
     99        // Force registration of compression. Fix #22303.
     100        CompressionRegistry.getDefaultInstance().registerApplicationClasspathSpis();
    98101    }
    99102
    100     private void checkEPSG() {
     103    private static void checkEPSG() {
    101104        try {
    102105            CRS.decode("EPSG:4326");
Note: See TracChangeset for help on using the changeset viewer.