Skip to main content

Reading an Multipage TIF -> Exception: width*height > Integer.MAX_VALUE!

8 replies [Last post]
ghagleit
Offline
Joined: 2009-07-17
Points: 0

Hi there,

i get the following exception when i try to read an an multipagetiff file. ( JPEG2000 codet )
I googled the exception and was able to find an issue number : 104

I read the mails and found an answer:

[QOUTE]
I think this is the same as jai-imageio-core issue 104. I've just committed a
change for this issue. Please try the daily build of 2007-12-20 and let us know
whether it is fixed.
[/QOUTE]

Then i tryed the build from yesterday but still the same problem.

My problem is, that i have to use Jai ImageIO becuase JAI can't decode the tiff ( it's JPEG200 codet ) image ( Decoder not supported exception)

Has somebody successfully resolved this problem?

best regards

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
marcojacob
Offline
Joined: 2006-07-10
Points: 0

I did a little more research and found an answer by Mike Nidel poiting that a
_tiled_ image with tile width x height <= MAX_INT should be no problem.

http://forums.java.net/jive/thread.jspa?messageID=249938&#249938

This is only supported if you don't decode as RenderedImage.

Message was edited by: marcojacob

Simone Giannecchini

One way to work around this problem with large untiled images is to
retile them on read by supplying an ImageLayout via RenderingHints
with proper tile size.

Simone.
-------------------------------------------------------
Ing. Simone Giannecchini
GeoSolutions S.A.S.
Owner - Software Engineer
Via Carignoni 51
55041 Camaiore (LU)
Italy

phone: +39 0584983027
fax: +39 0584983027
mob: +39 333 8128928

http://www.geo-solutions.it
http://geo-solutions.blogspot.com/
http://simboss.blogspot.com/
http://www.linkedin.com/in/simonegiannecchini

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

On Fri, Jul 17, 2009 at 9:04 PM, wrote:
> I did a little more research and found an answer by Mike Nidel poiting that a
> _tiled_ image with tile width x height <= MAX_INT should be no problem.
>
> http://forums.java.net/jive/thread.jspa?messageID=249938&#249938
> [Message sent by forum member 'marcojacob' (marcojacob)]
>
> http://forums.java.net/jive/thread.jspa?messageID=356317
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: interest-unsubscribe@jai-imageio.dev.java.net
> For additional commands, e-mail: interest-help@jai-imageio.dev.java.net
>
>

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

ghagleit
Offline
Joined: 2009-07-17
Points: 0

Thanks for you help, it works now for JPEG in TIFF with the ImageReader :-)

Is there any info on JPEG2000 in TIFF, will it ever be supported ?

best regards

ghagleit
Offline
Joined: 2009-07-17
Points: 0

yep you got it right, but then i don't understand the exception, what has the width/height to do with jpeg2k compression.
If i try to open an tiff with jpeg compression i get the same error.

according to this: http://markmail.org/message/xqefgqgqqvzgcmxc the issue is fixed.

best regards

marcojacob
Offline
Joined: 2006-07-10
Points: 0

J2k is not supported as compression inside TIFF. This is not a standard compression.
However the exception seems to occur reading the tiff header so you should be right
that this is not a j2k in TIFF issue.

Because you get the same error with JPEG in TIFF it seems either you downloaded
the wrong package, installed wrong or the issue is not really fixed or someone
fixed another issue that removed the other fix.

ghagleit
Offline
Joined: 2009-07-17
Points: 0

Hi,

i am pretty sure jai-imageio is able to decode jpeg2000 coded images because the Exception: width*height > Integer.MAX_VALUE! happens when i try to access an tile of the image.

If you check here: http://download.java.net/media/jai-imageio/javadoc/1.1/index.html
the jpeg2000 codec is listet

The images i have to work with are from an aperio imagescope scanner.
http://www.aperio.com/documents/api/Aperio_Digital_Slides_and_Third-part...

Simone Giannecchini

Ciao,
I am not saying that imageio is not able to read plain jpeg2k, I kind
of understood that you are trying to decode a tiff file that
internally uses jpeg2k compression. If I got this right, this might be
the problem.

Simone.
-------------------------------------------------------
Ing. Simone Giannecchini
GeoSolutions S.A.S.
Owner - Software Engineer
Via Carignoni 51
55041 Camaiore (LU)
Italy

phone: +39 0584983027
fax: +39 0584983027
mob: +39 333 8128928

http://www.geo-solutions.it
http://geo-solutions.blogspot.com/
http://simboss.blogspot.com/
http://www.linkedin.com/in/simonegiannecchini

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

On Fri, Jul 17, 2009 at 11:40 AM, wrote:
> Hi,
>
> i am pretty sure jai-imageio is able to decode jpeg2000 coded images because the  Exception: width*height > Integer.MAX_VALUE!  happens when i try to access an tile of the image.
>
> If you check here: http://download.java.net/media/jai-imageio/javadoc/1.1/index.html
> the jpeg2000 codec is listet
>
> The images i have to work with are from an aperio imagescope scanner.
> http://www.aperio.com/documents/api/Aperio_Digital_Slides_and_Third-part...
> [Message sent by forum member 'ghagleit' (ghagleit)]
>
> http://forums.java.net/jive/thread.jspa?messageID=356201
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: interest-unsubscribe@jai-imageio.dev.java.net
> For additional commands, e-mail: interest-help@jai-imageio.dev.java.net
>
>

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

Simone Giannecchini

I am not sure I understood your problem, but I do not think that
imageio can decode a tiff that uses jpeg2k as its compression scheme.

Simone.
-------------------------------------------------------
Ing. Simone Giannecchini
GeoSolutions S.A.S.
Owner - Software Engineer
Via Carignoni 51
55041 Camaiore (LU)
Italy

phone: +39 0584983027
fax: +39 0584983027
mob: +39 333 8128928

http://www.geo-solutions.it
http://geo-solutions.blogspot.com/
http://simboss.blogspot.com/
http://www.linkedin.com/in/simonegiannecchini

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

On Fri, Jul 17, 2009 at 10:44 AM, wrote:
> jai-imageio-core issue 104

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