hey Pepe, On 24.05.2021 15:04, Giuseppe Aruta wrote: SNIP > First of all, I discovered that jai_codec-1.1.3.jar and jai_core-1.1.3.jar > files are missing in both Core and Plus version OpenJUMP-20210523-r4895 > distros. I had to move a copy of this two files from a previous version of > OJ into OJ/LIB folder to load tiff (strangely OJ without JAI can still load > a tiff/tfw or a monoband tif file; the first is displayed in the correct > position while the second is shift to upper/left coordinates 0-0)
actually the sun jai jars were only missing in CORE distros. in PLUS they are located in lib/etc/imageio-ext/ as i falsely assumed we hold no dependency to them. unfortunately we do in our org.libtiff.jai.codec.XTIFF* code, which we use to traverse TIFF tags. i'll add them again as CORE dependencies for now, but we should really find a way to replace these outdated/proprietary libs. unfortunately they also seem to be needed for the JAI codec registering and such. will have to read up what the replacement API is for that. > *OpenJUMP-20210523-r4895 - Using ReferenceImage * > * > * > Loading Tif/Tfw and Multinband files. They are loaded with no problem at the > exact position > > D) loading Monoband geotiff file.Error message: > / (Referenced Image Exception) > [ERROR] 14:32:47.991 java.lang.ArrayIndexOutOfBoundsException > com.vividsolutions.jump.workbench.imagery.ReferencedImageException: > java.lang.ArrayIndexOutOfBoundsException > at > com.vividsolutions.jump.workbench.imagery.geoimg.GeoImage.paint(GeoImage.java:307)/ > > I was expecting this as AFAIR all tiff libraries related to ReferenceImage > never worked fine with this type of file indeed they didn't. BufferedImage(Commons) can read them though. can someone check that please? also Peppe. i don't recall, did you try BufferedImage(Commons) with your monoband dem files? i am asking because it might make sense to replace the somewhat hackish state of RasterImage reading with a cleaner way using apache commons, as Rasterimage is buffering the whole file in memory anyway. > *OpenJUMP-20210523-r4895 - Using RasterImageLayer* > > Loading monoband geotiff or multiband tiff: everything is file, files are > loaded at the correct position*.* > * > * > Loading tif/tfw file > The file is not loaded. Java console shows an error message: > /[ERROR] 14:38:59.945 java.lang.NullPointerException > java.lang.NullPointerException > at > org.openjump.core.rasterimage.AddRasterImageLayerWizard.addImage(AddRasterImageLayerWizard.java:231) > at > org.openjump.core.rasterimage.AddRasterImageLayerWizard.open(AddRasterImageLayerWizard.java:161)/ > > This bug probably came out before JTS 1.8 migration. But nobody realized, > including me, as usually we use RasterImageLayer only for DTM which are > usually (or the one I studied) geotagged tif files i fixed the loading part by making ProjUtils.getSRSInfoFromLayerSource(RasterImageLayer layer) more robust. https://github.com/openjump-gis/openjump/commit/ec86df4519300df662a3425be4876009b5cf2da9 issue still remains in RasterImageLayerPropertiesPlugIn (see below), which is trying to read it from file again(!) in a separate routine, which is really bad coding, as the result of the first run should have either be attached to the layer or the georefdimg in the first place. please find a way to reuse the value! sunny regards ..ede [ERROR] 20:32:04.709 Unknown value: 0.9 0.9 0 for: 33550 (0x830e: ModelPixelScaleTag): at com.vividsolutions.jump.workbench.ui.WorkbenchFrame.handleThrowable(WorkbenchFrame.java:1243) org.apache.commons.imaging.ImageReadException: Unknown value: 0.9 0.9 0 for: 33550 (0x830e: ModelPixelScaleTag): at org.apache.commons.imaging.formats.tiff.TiffField.getDoubleArrayValue(TiffField.java:507) at org.openjump.core.rasterimage.TiffTags.readMetadata(TiffTags.java:63) at org.openjump.core.ui.plugin.raster.RasterImageLayerPropertiesPlugIn.setInfo(RasterImageLayerPropertiesPlugIn.java:425) at org.openjump.core.ui.plugin.raster.RasterImageLayerPropertiesPlugIn.infoText(RasterImageLayerPropertiesPlugIn.java:243) at org.openjump.core.ui.plugin.raster.RasterImageLayerPropertiesPlugIn.execute(RasterImageLayerPropertiesPlugIn.java:358) at com.vividsolutions.jump.workbench.plugin.AbstractPlugIn$1.actionPerformed(AbstractPlugIn.java:355) at java.desktop/javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1967) at java.desktop/javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2308) at java.desktop/javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:405) at java.desktop/javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:262) at java.desktop/javax.swing.AbstractButton.doClick(AbstractButton.java:369) at java.desktop/javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1012) at java.desktop/javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:1056) at java.desktop/java.awt.Component.processMouseEvent(Component.java:6614) at java.desktop/javax.swing.JComponent.processMouseEvent(JComponent.java:3342) at java.desktop/java.awt.Component.processEvent(Component.java:6379) at java.desktop/java.awt.Container.processEvent(Container.java:2263) at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:4990) at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2321) at java.desktop/java.awt.Component.dispatchEvent(Component.java:4822) at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4919) at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4548) at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4489) at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2307) at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2769) at java.desktop/java.awt.Component.dispatchEvent(Component.java:4822) at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:772) at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721) at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:715) at java.base/java.security.AccessController.doPrivileged(AccessController.java:391) at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85) at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:95) at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:745) at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:743) at java.base/java.security.AccessController.doPrivileged(AccessController.java:391) at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85) at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:742) at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203) at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124) at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113) at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109) at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101) at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90) _______________________________________________ Jump-pilot-devel mailing list Jump-pilot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel