ImageLab problems with JPG+World image

8 messages Options
Embed this post
Permalink
mbedward

ImageLab problems with JPG+World image

Reply Threaded More More options
Print post
Permalink
Hi Jody,

I just tried out your changes to the ImageLab example with the
earthlights jpg+world format raster. The image initially loads and
displays properly but if I zoom in it throws a
CoverageProcessingException (see below).

Geotiff is working fine.

Any ideas ?

Simone any tips here ?

cheers
Michael

[exec:exec]
Oct 6, 2009 3:10:26 PM org.geotools.renderer.lite.StreamingRenderer
drawOptimized
SEVERE: org.geotools.coverage.processing.CoverageProcessingException:
org.geotools.coverage.processing.CoverageProcessingException:
org.geotools.coverage.processing.CoverageProcessingException:
org.geotools.coverage.processing.CoverageProcessingException:
java.lang.RuntimeException: javax.imageio.IIOException: Improper call
to JPEG library in state 202
org.geotools.coverage.processing.CoverageProcessingException:
org.geotools.coverage.processing.CoverageProcessingException:
org.geotools.coverage.processing.CoverageProcessingException:
org.geotools.coverage.processing.CoverageProcessingException:
org.geotools.coverage.processing.CoverageProcessingException:
java.lang.RuntimeException: javax.imageio.IIOException: Improper call
to JPEG library in state 202
        at org.geotools.renderer.lite.gridcoverage2d.BaseCoverageProcessingNode.getOutput(BaseCoverageProcessingNode.java:339)
        at org.geotools.renderer.lite.gridcoverage2d.BaseCoverageProcessingNode.getOutput(BaseCoverageProcessingNode.java:42)
        at org.geotools.renderer.lite.gridcoverage2d.StyleVisitorCoverageProcessingNodeAdapter.getOutput(StyleVisitorCoverageProcessingNodeAdapter.java:172)
        at org.geotools.renderer.lite.gridcoverage2d.GridCoverageRenderer.paint(GridCoverageRenderer.java:622)
        at org.geotools.renderer.lite.StreamingRenderer.renderRaster(StreamingRenderer.java:2056)
        at org.geotools.renderer.lite.StreamingRenderer.processSymbolizers(StreamingRenderer.java:1928)
        at org.geotools.renderer.lite.StreamingRenderer.process(StreamingRenderer.java:1874)
        at org.geotools.renderer.lite.StreamingRenderer.drawOptimized(StreamingRenderer.java:1816)
        at org.geotools.renderer.lite.StreamingRenderer.processStylers(StreamingRenderer.java:1731)
        at org.geotools.renderer.lite.StreamingRenderer.paint(StreamingRenderer.java:676)
        at org.geotools.swing.JMapPane.paintComponent(JMapPane.java:708)
        at javax.swing.JComponent.paint(JComponent.java:1006)
        at javax.swing.JComponent._paintImmediately(JComponent.java:4890)
        at javax.swing.JComponent.paintImmediately(JComponent.java:4676)
        at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:477)
        at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(SystemEventQueueUtilities.java:114)
        at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
        at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:269)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:190)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:184)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:176)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
Caused by: org.geotools.coverage.processing.CoverageProcessingException:
org.geotools.coverage.processing.CoverageProcessingException:
org.geotools.coverage.processing.CoverageProcessingException:
org.geotools.coverage.processing.CoverageProcessingException:
java.lang.RuntimeException: javax.imageio.IIOException: Improper call
to JPEG library in state 202
        at org.geotools.renderer.lite.gridcoverage2d.BaseCoverageProcessingNode.getOutput(BaseCoverageProcessingNode.java:339)
        at org.geotools.renderer.lite.gridcoverage2d.BaseCoverageProcessingNode.getOutput(BaseCoverageProcessingNode.java:42)
        at org.geotools.renderer.lite.gridcoverage2d.StyleVisitorCoverageProcessingNodeAdapter.getOutput(StyleVisitorCoverageProcessingNodeAdapter.java:172)
        at org.geotools.renderer.lite.gridcoverage2d.SubchainStyleVisitorCoverageProcessingAdapter.execute(SubchainStyleVisitorCoverageProcessingAdapter.java:112)
        at org.geotools.renderer.lite.gridcoverage2d.RasterSymbolizerHelper.execute(RasterSymbolizerHelper.java:66)
        at org.geotools.renderer.lite.gridcoverage2d.RasterSymbolizerHelper.execute(RasterSymbolizerHelper.java:46)
        at org.geotools.renderer.lite.gridcoverage2d.StyleVisitorCoverageProcessingNodeAdapter$1.execute(StyleVisitorCoverageProcessingNodeAdapter.java:132)
        at org.geotools.renderer.lite.gridcoverage2d.BaseCoverageProcessingNode.checkExecuted(BaseCoverageProcessingNode.java:235)
        at org.geotools.renderer.lite.gridcoverage2d.BaseCoverageProcessingNode.getOutput(BaseCoverageProcessingNode.java:337)
        ... 22 more
Caused by: org.geotools.coverage.processing.CoverageProcessingException:
org.geotools.coverage.processing.CoverageProcessingException:
org.geotools.coverage.processing.CoverageProcessingException:
java.lang.RuntimeException: javax.imageio.IIOException: Improper call
to JPEG library in state 202
        at org.geotools.renderer.lite.gridcoverage2d.BaseCoverageProcessingNode.getOutput(BaseCoverageProcessingNode.java:339)
        at org.geotools.renderer.lite.gridcoverage2d.BaseCoverageProcessingNode.getOutput(BaseCoverageProcessingNode.java:42)
        at org.geotools.renderer.lite.gridcoverage2d.StyleVisitorCoverageProcessingNodeAdapter.getOutput(StyleVisitorCoverageProcessingNodeAdapter.java:172)
        at org.geotools.renderer.lite.gridcoverage2d.ContrastEnhancementNode.execute(ContrastEnhancementNode.java:224)
        at org.geotools.renderer.lite.gridcoverage2d.ContrastEnhancementNode.execute(ContrastEnhancementNode.java:74)
        at org.geotools.renderer.lite.gridcoverage2d.StyleVisitorCoverageProcessingNodeAdapter$1.execute(StyleVisitorCoverageProcessingNodeAdapter.java:132)
        at org.geotools.renderer.lite.gridcoverage2d.BaseCoverageProcessingNode.checkExecuted(BaseCoverageProcessingNode.java:235)
        at org.geotools.renderer.lite.gridcoverage2d.BaseCoverageProcessingNode.getOutput(BaseCoverageProcessingNode.java:337)
        ... 30 more
Caused by: org.geotools.coverage.processing.CoverageProcessingException:
org.geotools.coverage.processing.CoverageProcessingException:
java.lang.RuntimeException: javax.imageio.IIOException: Improper call
to JPEG library in state 202
        at org.geotools.renderer.lite.gridcoverage2d.BaseCoverageProcessingNode.getOutput(BaseCoverageProcessingNode.java:339)
        at org.geotools.renderer.lite.gridcoverage2d.BaseCoverageProcessingNode.getOutput(BaseCoverageProcessingNode.java:42)
        at org.geotools.renderer.lite.gridcoverage2d.StyleVisitorCoverageProcessingNodeAdapter.getOutput(StyleVisitorCoverageProcessingNodeAdapter.java:172)
        at org.geotools.renderer.lite.gridcoverage2d.ColorMapNode.execute(ColorMapNode.java:276)
        at org.geotools.renderer.lite.gridcoverage2d.ColorMapNode.execute(ColorMapNode.java:53)
        at org.geotools.renderer.lite.gridcoverage2d.StyleVisitorCoverageProcessingNodeAdapter$1.execute(StyleVisitorCoverageProcessingNodeAdapter.java:132)
        at org.geotools.renderer.lite.gridcoverage2d.BaseCoverageProcessingNode.checkExecuted(BaseCoverageProcessingNode.java:235)
        at org.geotools.renderer.lite.gridcoverage2d.BaseCoverageProcessingNode.getOutput(BaseCoverageProcessingNode.java:337)
        ... 37 more
Caused by: org.geotools.coverage.processing.CoverageProcessingException:
java.lang.RuntimeException: javax.imageio.IIOException: Improper call
to JPEG library in state 202
        at org.geotools.renderer.lite.gridcoverage2d.BaseCoverageProcessingNode.getOutput(BaseCoverageProcessingNode.java:339)
        at org.geotools.renderer.lite.gridcoverage2d.BaseCoverageProcessingNode.getOutput(BaseCoverageProcessingNode.java:42)
        at org.geotools.renderer.lite.gridcoverage2d.SubchainStyleVisitorCoverageProcessingAdapter.execute(SubchainStyleVisitorCoverageProcessingAdapter.java:112)
        at org.geotools.renderer.lite.gridcoverage2d.StyleVisitorCoverageProcessingNodeAdapter$1.execute(StyleVisitorCoverageProcessingNodeAdapter.java:132)
        at org.geotools.renderer.lite.gridcoverage2d.BaseCoverageProcessingNode.checkExecuted(BaseCoverageProcessingNode.java:235)
        at org.geotools.renderer.lite.gridcoverage2d.BaseCoverageProcessingNode.getOutput(BaseCoverageProcessingNode.java:337)
        ... 44 more
Caused by: java.lang.RuntimeException: javax.imageio.IIOException:
Improper call to JPEG library in state 202
        at com.sun.media.jai.imageioimpl.ImageReadOpImage.computeTile(ImageReadOpImage.java:706)
        at com.sun.media.jai.util.SunTileScheduler.scheduleTile(SunTileScheduler.java:912)
        at javax.media.jai.OpImage.getTile(OpImage.java:1148)
        at com.sun.media.jai.opimage.CropOpImage.getTile(CropOpImage.java:133)
        at javax.media.jai.PointOpImage.computeTile(PointOpImage.java:967)
        at com.sun.media.jai.util.SunTileScheduler.scheduleTile(SunTileScheduler.java:912)
        at javax.media.jai.OpImage.getTile(OpImage.java:1139)
        at javax.media.jai.PointOpImage.computeTile(PointOpImage.java:916)
        at com.sun.media.jai.util.SunTileScheduler.scheduleTile(SunTileScheduler.java:912)
        at javax.media.jai.OpImage.getTile(OpImage.java:1139)
        at javax.media.jai.PointOpImage.computeTile(PointOpImage.java:916)
        at com.sun.media.jai.util.SunTileScheduler.scheduleTile(SunTileScheduler.java:912)
        at javax.media.jai.OpImage.getTile(OpImage.java:1139)
        at javax.media.jai.NullOpImage.computeTile(NullOpImage.java:170)
        at com.sun.media.jai.util.SunTileScheduler.scheduleTile(SunTileScheduler.java:912)
        at javax.media.jai.OpImage.getTile(OpImage.java:1139)
        at javax.media.jai.RenderedOp.getTile(RenderedOp.java:2268)
        at com.sun.media.jai.iterator.RectIterCSM.setDataBuffer(RectIterCSM.java:78)
        at com.sun.media.jai.iterator.RectIterFallback.<init>(RectIterFallback.java:155)
        at com.sun.media.jai.iterator.RectIterCSM.<init>(RectIterCSM.java:44)
        at com.sun.media.jai.iterator.RectIterCSMByte.<init>(RectIterCSMByte.java:33)
        at javax.media.jai.iterator.RectIterFactory.create(RectIterFactory.java:90)
        at org.geotools.coverage.grid.RenderedSampleDimension.create(RenderedSampleDimension.java:138)
        at org.geotools.coverage.grid.GridCoverage2D.<init>(GridCoverage2D.java:233)
        at org.geotools.coverage.grid.GridCoverageFactory.create(GridCoverageFactory.java:598)
        at org.geotools.renderer.lite.gridcoverage2d.BandMergeNode.execute(BandMergeNode.java:212)
        at org.geotools.renderer.lite.gridcoverage2d.BaseCoverageProcessingNode.checkExecuted(BaseCoverageProcessingNode.java:235)
        at org.geotools.renderer.lite.gridcoverage2d.BaseCoverageProcessingNode.getOutput(BaseCoverageProcessingNode.java:337)
        ... 49 more
Caused by: javax.imageio.IIOException: Improper call to JPEG library
in state 202
        at com.sun.imageio.plugins.jpeg.JPEGImageReader.readImageHeader(Native
Method)
        at com.sun.imageio.plugins.jpeg.JPEGImageReader.readNativeHeader(JPEGImageReader.java:560)
        at com.sun.imageio.plugins.jpeg.JPEGImageReader.readHeader(JPEGImageReader.java:554)
        at com.sun.imageio.plugins.jpeg.JPEGImageReader.readInternal(JPEGImageReader.java:928)
        at com.sun.imageio.plugins.jpeg.JPEGImageReader.read(JPEGImageReader.java:912)
        at com.sun.media.jai.imageioimpl.ImageReadOpImage.computeTile(ImageReadOpImage.java:697)
        ... 76 more

------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
Geotools-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geotools-devel
mbedward

Re: ImageLab problems with JPG+World image

Reply Threaded More More options
Print post
Permalink
A follow up on that last message...

It must be a pom problem. When I run ImageLab within the demo/example
project all is well: I can zoom in on the earthlights image to my
heart's content :)  When I run it in a separate project, which I set
up to check dependencies, it bombs.

In the test project's pom I have:
gt-epsg-hsql
gt-geotiff
gt-image
gt-main
gt-shapefile
gt-swing

JAI gets pulled in transitively.

What am I missing ?

Michael

------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
Geotools-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geotools-devel
Jody Garnett-2

Re: ImageLab problems with JPG+World image

Reply Threaded More More options
Print post
Permalink
In reply to this post by mbedward
I tried with clouds.jpg and did not have any trouble ...

A couple other references to the error:
- http://n2.nabble.com/Improper-call-to-JPEG-library-in-state-202-td1941709.html
- http://objectmix.com/graphics/343188-improper-call-jpeg-library-state-202-error-prog-read-ajpeg-file.html
- http://www.mail-archive.com/geotools-gt2-users@.../msg04738.html

I am going to assume it is a problem with that file?

On Tue, Oct 6, 2009 at 3:19 PM, Michael Bedward
<[hidden email]> wrote:

> I just tried out your changes to the ImageLab example with the
> earthlights jpg+world format raster. The image initially loads and
> displays properly but if I zoom in it throws a
> CoverageProcessingException (see below).
>
> Geotiff is working fine.
> Any ideas ?
>
> Simone any tips here ?
>
> cheers
> Michael
> SEVERE: org.geotools.coverage.processing.CoverageProcessingException:
> org.geotools.coverage.processing.CoverageProcessingException:
> org.geotools.coverage.processing.CoverageProcessingException:
> org.geotools.coverage.processing.CoverageProcessingException:
> java.lang.RuntimeException: javax.imageio.IIOException: Improper call
> to JPEG library in state 202

------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
Geotools-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geotools-devel
Jody Garnett-2

Re: ImageLab problems with JPG+World image

Reply Threaded More More options
Print post
Permalink
In reply to this post by mbedward
Sometimes there is a difference between the JAI image reader used for
JPG depending on if it is a native reader or a pure java reader. In
udig I had to rewrite the JAI lookup code myself in order to skip over
the native writers (since they were failing on windows or something).
In the past we have explicilty ignored some implementations ... but I
have not heard of any problems lately.

So when you run demo/example are you using a different JRE then when
you run it as a separate project?

Jody

On Tue, Oct 6, 2009 at 3:38 PM, Michael Bedward
<[hidden email]> wrote:

> A follow up on that last message...
>
> It must be a pom problem. When I run ImageLab within the demo/example
> project all is well: I can zoom in on the earthlights image to my
> heart's content :)  When I run it in a separate project, which I set
> up to check dependencies, it bombs.
>
> In the test project's pom I have:
> gt-epsg-hsql
> gt-geotiff
> gt-image
> gt-main
> gt-shapefile
> gt-swing
>
> JAI gets pulled in transitively.
>
> What am I missing ?
>
> Michael
>

------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
Geotools-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geotools-devel
mbedward

Re: ImageLab problems with JPG+World image

Reply Threaded More More options
Print post
Permalink
Hi Jody

> So when you run demo/example are you using a different JRE then when
> you run it as a separate project?
>

No - I'm not that clever :-)

I'm just about to try both projects again now and see if I get the same results.

Michael

------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
Geotools-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geotools-devel
mbedward

Re: ImageLab problems with JPG+World image

Reply Threaded More More options
Print post
Permalink
I just tried it again with similar results. It works fine within the
example project but has problems in the stand-alone project.

This time the problem was slightly different: on zooming in the raster
just didn't display. When I tried to provoke it using the style menu
it threw an exception as before.

As an aside: I sympathize with those users who complain that
identifying the right dependencies can be a bit of a puzzle !

Michael

------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
Geotools-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geotools-devel
Jody Garnett-2

Re: ImageLab problems with JPG+World image

Reply Threaded More More options
Print post
Permalink
I suspect that you are running from the JDK in one enviroment (say
your IDE?) and from a JRE in another (say standalone application).
Have you installed native JAI or ImageIO at anypoint?

Jody

On Tue, Oct 6, 2009 at 3:56 PM, Michael Bedward
<[hidden email]> wrote:

> I just tried it again with similar results. It works fine within the
> example project but has problems in the stand-alone project.
>
> This time the problem was slightly different: on zooming in the raster
> just didn't display. When I tried to provoke it using the style menu
> it threw an exception as before.
>
> As an aside: I sympathize with those users who complain that
> identifying the right dependencies can be a bit of a puzzle !
>
> Michael
>

------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
Geotools-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geotools-devel
mbedward

Re: ImageLab problems with JPG+World image

Reply Threaded More More options
Print post
Permalink
Mmm... there is a difference.

When I run demo/example from within the IDE I get this...

NetBeans: Executing '/opt/local/apache-maven-2.1.0/bin/mvn
-Dexec.args=-Xmx1024m -classpath %classpath org.geotools.demo.ImageLab
-Dexec.executable=/System/Library/Frameworks/JavaVM.framework/Versions/1.5/Home/bin/java
-Dnetbeans.execution=true --fail-fast --no-plugin-registry
process-classes org.codehaus.mojo:exec-maven-plugin:1.1:exec'
NetBeans:      JAVA_HOME
=/System/Library/Frameworks/JavaVM.framework/Versions/1.5/Home

Whereas when I run the test project I get this...

NetBeans: Executing '/opt/local/apache-maven-2.1.0/bin/mvn
-Dexec.classpathScope=runtime -Dexec.args=-classpath %classpath
org.geotools.demo.runexample.ImageLab
-Dexec.executable=/System/Library/Frameworks/JavaVM.framework/Versions/1.5/Home/bin/java
-Dnetbeans.execution=true --fail-fast --no-plugin-registry
process-classes org.codehaus.mojo:exec-maven-plugin:1.1.1:exec'
NetBeans:      JAVA_HOME
=/System/Library/Frameworks/JavaVM.framework/Versions/1.5/Home

Which has -Dexec.classpathScope=runtime

Michael

------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
Geotools-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geotools-devel