Hey Peppe,

I've commited some changes that should fix most of the issues. I don't know how to solve the problem of the GIF files being read as monoband: it's something related to javax.imageio classes, I'lll see what I can do.

Alberto

On 28/01/2015 16:16 PM, Giuseppe Aruta wrote:
Hi Alberto,
I tested this new OpenJump.jar, using RasterImage Layer class. I did a large test to check also the other file formats. I listed below the results

*Loading multiband files: *
1) JPG, OK
2) PNG, OK
3) TIF, OK
4) GIF. Only one band is loaded, It seems to me band 0 and the image is displayed as B/W

*Loading monoband raster*
1) TIF, OK
2) ASC, OK
3) FLT, OK
4) PNG, OK

*Saving multiband files as TIF*
1) save JPG to TIF Null point exception
java.lang.NullPointerException
at org.openjump.core.ui.plugin.layer.pirolraster.SaveRasterImageAsImagePlugIn.execute(SaveRasterImageAsImagePlugIn.java:131)
2) save PNG to TIFF, OK
3) Save TIF to TIF, OK
4) Save GIF to TIF, OK (Saved file is monoband , as the displayed)

*Saving monoband as TIF*
1) TIF, OK
2) ASC, OK
3) FLT, OK
4) PNG, OK

*Extract part of selected image (monoband files)*
1) TIF, OK
2) ASC, OK
3) FLT, OK
4) PNG, OK

*Extract part of selected image (multiband  files)*
I had problems. All extractions failed with a error message. I listed below all these messages
1) *JPG,* java.lang.NullPointerException
at org.openjump.core.rasterimage.RasterImageIO.writeImage(RasterImageIO.java:664) at org.openjump.core.ui.plugin.layer.pirolraster.ExtractSelectedPartOfImage.execute(ExtractSelectedPartOfImage.java:89) 2) *PNG,* Javax.media.jai.util.ImagingException: All factories fail for the operation "scale" at javax.media.jai.OperationRegistry.invokeFactory(OperationRegistry.java:1687) at javax.media.jai.ThreadSafeOperationRegistry.invokeFactory(ThreadSafeOperationRegistry.java:473)
    at javax.media.jai.registry.RIFRegistry.create(RIFRegistry.java:332)
    at javax.media.jai.RenderedOp.createInstance(RenderedOp.java:819)
    at javax.media.jai.RenderedOp.createRendering(RenderedOp.java:867)
    at javax.media.jai.RenderedOp.getWidth(RenderedOp.java:2179)
at org.openjump.core.rasterimage.TiffUtils.readImage(TiffUtils.java:85) at org.openjump.core.rasterimage.RasterImageIO.loadImage(RasterImageIO.java:131) at org.openjump.core.ui.plugin.layer.pirolraster.ExtractSelectedPartOfImage.execute(ExtractSelectedPartOfImage.java:102)
3) *TIF,*java.lang.NullPointerException
at org.openjump.core.ui.plugin.layer.pirolraster.ExtractSelectedPartOfImage.execute(ExtractSelectedPartOfImage.java:90) at com.vividsolutions.jump.workbench.plugin.AbstractPlugIn$1.actionPerformed(AbstractPlugIn.java:342) at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2018) at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2341) at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402) at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
    at javax.swing.AbstractButton.doClick(AbstractButton.java:376)
4)***GIF. *javax.media.jai.util.ImagingException: All factories fail for the operation "scale" at javax.media.jai.OperationRegistry.invokeFactory(OperationRegistry.java:1687) at javax.media.jai.ThreadSafeOperationRegistry.invokeFactory(ThreadSafeOperationRegistry.java:473)
    at javax.media.jai.registry.RIFRegistry.create(RIFRegistry.java:332)
    at javax.media.jai.RenderedOp.createInstance(RenderedOp.java:819)
    at javax.media.jai.RenderedOp.createRendering(RenderedOp.java:867)
    at javax.media.jai.RenderedOp.getWidth(RenderedOp.java:2179)
at org.openjump.core.rasterimage.TiffUtils.readImage(TiffUtils.java:85) at org.openjump.core.rasterimage.RasterImageIO.loadImage(RasterImageIO.java:131) at org.openjump.core.ui.plugin.layer.pirolraster.ExtractSelectedPartOfImage.execute(ExtractSelectedPartOfImage.java:102)

Loading, saving extracting parts of monoband raster is fine. Problems come with multiband files.
Peppe

2015-01-28 12:06 GMT+01:00 Alberto De Luca - GeA <alberto.del...@geomaticaeambiente.com <mailto:alberto.del...@geomaticaeambiente.com>>:

    Peppe,

    I fixed an issue related to single-band PNGs.

    With regards to JPGs, I can load with no problem in my Windows
    machine all the samples you attached to your mail. Nevertheless,
    the problem you see should be related to JAI: in snapshot 4090 the
    read operation was made using ImageIO.read, while in snapshot 4283
    is made using JAI.create("fileload", ...). I've now modified the
    code so that ImageIO.read() is used first, and JAI.create() only
    as a fallback if ImageIO fails. The weird thing is that in r4283
    JAI is however used to load TIFF files, but it appears that you
    can load them no problem...

    Since I cannot reproduce your error, before committing I'd like
    you to test these changes. Could you please download this
    <https://www.dropbox.com/s/fexjyucup49hihn/OpenJUMP-0.0.0-rnull.jar?dl=0>
    OpenJUMP.jar, replace it to the one you have in snapshot 4283 and
    tell me how it behaves?

    Thanks
    Alberto

    
------------------------------------------------------------------------------
    Dive into the World of Parallel Programming. The Go Parallel Website,
    sponsored by Intel and developed in partnership with Slashdot
    Media, is your
    hub for all things parallel software development, from weekly thought
    leadership blogs to news, videos, case studies, tutorials and
    more. Take a
    look and join the conversation now. http://goparallel.sourceforge.net/
    _______________________________________________
    Jump-pilot-devel mailing list
    Jump-pilot-devel@lists.sourceforge.net
    <mailto:Jump-pilot-devel@lists.sourceforge.net>
    https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel




------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/


_______________________________________________
Jump-pilot-devel mailing list
Jump-pilot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel

------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Jump-pilot-devel mailing list
Jump-pilot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel

Reply via email to