Skip to main content

[JAI-IMAGEIO] JPEG2000 users: Please test recent daily build if you have time

2 replies [Last post]
Anonymous

The release of the 1.1-fcs version will be in the not so distant future and a
number of fixes have been checked in. It would be great if you have some time
to test some of these before the actual release. The recent fixes include:

* jai-imageio-core issue 82: JPEG2000 dyadic wavelet transform limited
to 5 levels

* codecLib native code update:
https://jai-imageio.dev.java.net/servlets/ReadMsg?list=interest&msgNo=818)

* jai-imageio-core issue 22: JPEG2000 writer does not preserve bit depth
properly

* jai-imageio-core issue 26: Java-based JPEG 2000 reader throws
RuntimeException

* java.sun.com bug 5089981 A lower resolution image decoded from a JPEG2000
image has incorrect image dimensions

* fix for java.sun.com bug 6175702 The Java and codecLib JPEG2000 ImageReader
impls behave differently when resolution level is set

There was also one fix to ensure that all TIFF IFDs and all field values with
size greater than four bytes are written at offsets which are on word
boundaries.

Thanks,

Brian

----------------
Brian Burkhalter
Java Media, Imaging, and Graphics
Sun Microsystems, Inc.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This email message is for the sole use of the intended recipient(s)
and may contain confidential and privileged information. Any
unauthorized review, use, disclosure or distribution is prohibited.
If you are not the intended recipient, please contact the sender by
reply email and destroy all copies of the original message.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@jai-imageio.dev.java.net
For additional commands, e-mail: interest-help@jai-imageio.dev.java.net

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Simone Giannecchini

I am constantly checking the JPEG2K plugin since I would really like
to use it inside the GIS projects I am working on which are GeoTools
and GeoServer.

I have spent the afternoon testing the latest sources from CVS of the
jpeg2k plugin and here you have my impressions.

On 9/28/06, Brian Burkhalter wrote:
> The release of the 1.1-fcs version will be in the not so distant future and a
> number of fixes have been checked in. It would be great if you have some time
> to test some of these before the actual release. The recent fixes include:
>
> * jai-imageio-core issue 82: JPEG2000 dyadic wavelet transform limited
> to 5 levels
>
I encoded a 1200m geotiff as a JPEG2k using the native decoder and
everything went pretty fine. I used 12 levels with lossless and lossy
compression.

> * codecLib native code update:
> https://jai-imageio.dev.java.net/servlets/ReadMsg?list=interest&msgNo=818)
>
> * jai-imageio-core issue 22: JPEG2000 writer does not preserve bit depth
> properly
>
> * jai-imageio-core issue 26: Java-based JPEG 2000 reader throws
> RuntimeException
>
Strange enough, I still get this error sometimes on some imges.

> * java.sun.com bug 5089981 A lower resolution image decoded from a JPEG2000
> image has incorrect image dimensions
>
> * fix for java.sun.com bug 6175702 The Java and codecLib JPEG2000 ImageReader
> impls behave differently when resolution level is set
>

This is a small lie, the fix is not a real fix but a workaround, I
check the code and I noticed that iamgeio just do not use the native
codec when J2KImageReadParam.getResolution() >= 0. I noticed this
because when using the native reader I decode images very fast while
the one based on jj2000 is considerably slower and sometimes throws
exceptions as stated above. Infact I was seeing this trange situation
of decoding the highest res level image but not the subsequents. I was
getting the following stack trace again and again...

Caused by: java.lang.RuntimeException: File is neither valid JP2 file
nor valid JPEG 2000 codestream
at com.sun.media.imageioimpl.plugins.jpeg2000.J2KReadState.initializeRead(J2KReadState.java:703)
at com.sun.media.imageioimpl.plugins.jpeg2000.J2KReadState.(J2KReadState.java:180)
at com.sun.media.imageioimpl.plugins.jpeg2000.J2KImageReader.read(J2KImageReader.java:439)
at com.sun.media.imageioimpl.plugins.jpeg2000.J2KImageReaderCodecLib.read(J2KImageReaderCodecLib.java:347)
at com.sun.media.jai.imageioimpl.ImageReadOpImage.computeTile(ImageReadOpImage.java:697)
at com.sun.media.jai.util.SunTileScheduler.scheduleTile(SunTileScheduler.java:904)
at javax.media.jai.OpImage.getTile(OpImage.java:1129)
at com.sun.media.jai.util.SunTileScheduler.compute(SunTileScheduler.java:717)
at com.sun.media.jai.util.TileJob.compute(SunTileScheduler.java:373)
at com.sun.media.jai.util.WorkerThread.run(SunTileScheduler.java:468)
Caused by: java.lang.Error: File is neither valid JP2 file nor valid
JPEG 2000 codestream
at jj2000.j2k.fileformat.reader.FileFormatReader.readFileFormat(FileFormatReader.java:182)
at com.sun.media.imageioimpl.plugins.jpeg2000.J2KReadState.initializeRead(J2KReadState.java:411)
... 9 more
Caused by:
java.lang.RuntimeException: File is neither valid JP2 file nor valid
JPEG 2000 codestream
at com.sun.media.imageioimpl.plugins.jpeg2000.J2KReadState.initializeRead(J2KReadState.java:703)
at com.sun.media.imageioimpl.plugins.jpeg2000.J2KReadState.(J2KReadState.java:180)
at com.sun.media.imageioimpl.plugins.jpeg2000.J2KImageReader.read(J2KImageReader.java:439)
at com.sun.media.imageioimpl.plugins.jpeg2000.J2KImageReaderCodecLib.read(J2KImageReaderCodecLib.java:347)
at com.sun.media.jai.imageioimpl.ImageReadOpImage.computeTile(ImageReadOpImage.java:697)
at com.sun.media.jai.util.SunTileScheduler.scheduleTile(SunTileScheduler.java:904)
at javax.media.jai.OpImage.getTile(OpImage.java:1129)
at com.sun.media.jai.util.SunTileScheduler.compute(SunTileScheduler.java:717)
at com.sun.media.jai.util.TileJob.compute(SunTileScheduler.java:373)
at com.sun.media.jai.util.WorkerThread.run(SunTileScheduler.java:468)
Caused by: java.lang.Error: File is neither valid JP2 file nor valid
JPEG 2000 codestream
at jj2000.j2k.fileformat.reader.FileFormatReader.readFileFormat(FileFormatReader.java:182)
at com.sun.media.imageioimpl.plugins.jpeg2000.J2KReadState.initializeRead(J2KReadState.java:411)
... 9 more

I can provide a JPEG2k file that generates this error if that helps.

> There was also one fix to ensure that all TIFF IFDs and all field values with
> size greater than four bytes are written at offsets which are on word
> boundaries.
>
> Thanks,
>
> Brian
>

I am going to test more since I really need JPEG2k capabilities in
ImageIO. It is a shame that we do not have it.

A suggestion/wish, what about using a different native lib than jasper
if it gives us so many problems? What about ERMapper SDK, the free
version is quite good I have been using in c++ for a while now.

Regards,
Simone.

> ----------------
> Brian Burkhalter
> Java Media, Imaging, and Graphics
> Sun Microsystems, Inc.
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> This email message is for the sole use of the intended recipient(s)
> and may contain confidential and privileged information. Any
> unauthorized review, use, disclosure or distribution is prohibited.
> If you are not the intended recipient, please contact the sender by
> reply email and destroy all copies of the original message.
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: interest-unsubscribe@jai-imageio.dev.java.net
> For additional commands, e-mail: interest-help@jai-imageio.dev.java.net
>
>

--
-------------------------------------------------------
Eng. Simone Giannecchini
President /CEO GeoSolutions

http://www.geo-solutions.it

-------------------------------------------------------

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@jai-imageio.dev.java.net
For additional commands, e-mail: interest-help@jai-imageio.dev.java.net

Brian Burkhalter

Simone,

On Fri, 29 Sep 2006, Simone Giannecchini wrote:

> I am constantly checking the JPEG2K plugin since I would really like
> to use it inside the GIS projects I am working on which are GeoTools
> and GeoServer.
>
> I have spent the afternoon testing the latest sources from CVS of the
> jpeg2k plugin and here you have my impressions.

Thank you for your efforts which are tremendously appreciated! I would like to
make a couple of comments with respect to the JPEG2000 plug-ins.

Firstly our present intention is to emphasize cleaning up the JPEG2000
plug-ins in the 1.2 (or perhaps it will be named 2.0) release of JAI Image I/O
Tools. Therefore we do not expect to solve all the problems in 1.1. In
fact delaying the 1.1 release will delay fixing the remaining problems.

Secondly, given the focus of 1.2/2.0, the objective right now is to ensure
that the recent fixes don't make things worse. Therefore we define success in
the latest 1.1 daily builds to be that some problems are fixed and nothing is
made worse.

> On 9/28/06, Brian Burkhalter wrote:
>> The release of the 1.1-fcs version will be in the not so distant future and
>> a
>> number of fixes have been checked in. It would be great if you have some
>> time
>> to test some of these before the actual release. The recent fixes include:
>>
>> * jai-imageio-core issue 82: JPEG2000 dyadic wavelet transform limited
>> to 5 levels
>>
> I encoded a 1200m geotiff as a JPEG2k using the native decoder and
> everything went pretty fine. I used 12 levels with lossless and lossy
> compression.

Great.

>> * codecLib native code update:
>> https://jai-imageio.dev.java.net/servlets/ReadMsg?list=interest&msgNo=818)
>>
>> * jai-imageio-core issue 22: JPEG2000 writer does not preserve bit depth
>> properly
>>
>> * jai-imageio-core issue 26: Java-based JPEG 2000 reader throws
>> RuntimeException
>>
> Strange enough, I still get this error sometimes on some imges.

If you could supply information sufficient to reproduce the problem please
re-open issue 26 and append the information. First however re-try it with the
2006-09-30 build or later or the CVS source.

>> * java.sun.com bug 5089981 A lower resolution image decoded from a JPEG2000
>> image has incorrect image dimensions
>>
>> * fix for java.sun.com bug 6175702 The Java and codecLib JPEG2000
>> ImageReader
>> impls behave differently when resolution level is set
>>
> This is a small lie, the fix is not a real fix but a workaround, I

You are absolutely correct. It is infeasible to fix this problem in the native
layer in the short time required. Therefore we thought it better to put in the
workaround at least to make things consistent. A separate bug has been filed
in the java.sun.com list here

http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6476371

where it may be voted on. Probably it should have been filed on java.net ...

> check the code and I noticed that iamgeio just do not use the native
> codec when J2KImageReadParam.getResolution() >= 0.

That is correct. We should also use the native decoder if getResolution()
returns the highest resolution available but cannot now because of this
problem:

http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6306685

> I noticed this
> because when using the native reader I decode images very fast while
> the one based on jj2000 is considerably slower and sometimes throws
> exceptions as stated above.

We thought it better to use the Java decoder for the lower resolutions instead
of getting progressively blurrier images of the full res image.

> Infact I was seeing this trange situation
> of decoding the highest res level image but not the subsequents.

So you are decoding in order of descending resolution?

> I was
> getting the following stack trace again and again...
>
> Caused by: java.lang.RuntimeException: File is neither valid JP2 file
> nor valid JPEG 2000 codestream
[...]
> com.sun.media.imageioimpl.plugins.jpeg2000.J2KReadState.initializeRead(J2KReadState.java:411)
> ... 9 more
>
> I can provide a JPEG2k file that generates this error if that helps.

I think I just fixed that. Please try this test with the 2006-09-30 build or
later or with the CVS.

> I am going to test more since I really need JPEG2k capabilities in
> ImageIO. It is a shame that we do not have it.

Well we are trying. It would be helpful to log issues observed if they are not
already on file.

> A suggestion/wish, what about using a different native lib than jasper
> if it gives us so many problems? What about ERMapper SDK, the free
> version is quite good I have been using in c++ for a while now.

I'm not sure that we can conclude right now that is it JasPer.

Thanks again so much for your help!

Brian

----------------
Brian Burkhalter
Java Media, Imaging, and Graphics
Sun Microsystems, Inc.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This email message is for the sole use of the intended recipient(s)
and may contain confidential and privileged information. Any
unauthorized review, use, disclosure or distribution is prohibited.
If you are not the intended recipient, please contact the sender by
reply email and destroy all copies of the original message.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@jai-imageio.dev.java.net
For additional commands, e-mail: interest-help@jai-imageio.dev.java.net