Page 1 of 1

JPEG reader limitation, Array size > Integer.MAX_VALUE!

PostPosted: Sat Feb 18, 2017 4:24 pm
by darwinjob
Hi
Apparently there is a resolution limitation in JPEG reader. JPEG image 39998x29998 causes this exception when read:
java.lang.IllegalArgumentException: Array size > Integer.MAX_VALUE!
at javax.imageio.ImageTypeSpecifier.createBufferedImage(ImageTypeSpecifier.java:1081)
at javax.imageio.ImageReader.getDestination(ImageReader.java:2896)
at com.sun.imageio.plugins.jpeg.JPEGImageReader.readInternal(JPEGImageReader.java:1066)
at com.sun.imageio.plugins.jpeg.JPEGImageReader.read(JPEGImageReader.java:1034)
at javax.imageio.ImageIO.read(ImageIO.java:1448)
at javax.imageio.ImageIO.read(ImageIO.java:1352)
at loci.formats.in.ImageIOReader.initImage(ImageIOReader.java:150)
at loci.formats.in.ImageIOReader.initFile(ImageIOReader.java:122)
at loci.formats.in.JPEGReader$DefaultJPEGReader.initFile(JPEGReader.java:190)
at loci.formats.FormatReader.setId(FormatReader.java:1401)
at loci.formats.DelegateReader.setId(DelegateReader.java:291)
at loci.formats.in.JPEGReader.setId(JPEGReader.java:89)
at loci.formats.ImageReader.setId(ImageReader.java:835)

Bioformats 5.2.2, Java 7

This is just FYI :geek:

Re: JPEG reader limitation, Array size > Integer.MAX_VALUE!

PostPosted: Mon Feb 20, 2017 2:18 pm
by bramalingam
Hi,

Thank you for submitting your issue.

This is a known issue of the JPEGReader and we do have an implementation plan for the same,
https://trello.com/c/M8PidMnv/103-use-j ... peg-images

This will get looked into at the earliest.
Hope that helps.

Best,
Balaji