javax.imageio.IIOException: Bogus marker length

JDK Bug System | Praveen Mohan | 1 decade ago
tip
Do you know that we can give you better hits? Get more relevant results from Samebug’s stack trace search.
  1. 0

    I am creating a buffered image through ImageIO by reading a jpeg image. I am creating an array list and adding this image to it. I am writing this image as well as the thumbnail list (same image is written as image as well as thumbnail) to a file. Writing process is successful. But when I read the image from this file through ImageIO.read(), I am getting an IIOException: Bogus marker length. This happens only when I use the same image as primary image as well as thumbnail image. This is noticed right from JDK1.4 on all platforms. I have attached the test and the image. Execute the test. If you get the following exception on the console, the bug is reproduced. javax.imageio.IIOException: Bogus marker length at com.sun.imageio.plugins.jpeg.JPEGImageReader.readImageHeader(Native Method) at com.sun.imageio.plugins.jpeg.JPEGImageReader.readNativeHeader(JPEGImageReader.java:554) at com.sun.imageio.plugins.jpeg.JPEGImageReader.checkTablesOnly(JPEGImageReader.java:309) at com.sun.imageio.plugins.jpeg.JPEGImageReader.gotoImage(JPEGImageReader.java:431) at com.sun.imageio.plugins.jpeg.JPEGImageReader.readHeader(JPEGImageReader.java:547) at com.sun.imageio.plugins.jpeg.JPEGImageReader.readInternal(JPEGImageReader.java:880) at com.sun.imageio.plugins.jpeg.JPEGImageReader.read(JPEGImageReader.java:864) at javax.imageio.ImageIO.read(ImageIO.java:1384) at javax.imageio.ImageIO.read(ImageIO.java:1270) at JPGReaderReadAllTest.<init>(JPGReaderReadAllTest.java:34) at JPGReaderReadAllTest.main(JPGReaderReadAllTest.java:50)

    JDK Bug System | 1 decade ago | Praveen Mohan
    javax.imageio.IIOException: Bogus marker length
  2. 0

    Reading picture from byte array

    Stack Overflow | 3 years ago | Edison
    javax.imageio.IIOException: Error reading PNG image data at com.sun.imageio.plugins.png.PNGImageReader.readImage(Unknown Source)
  3. Speed up your debug routine!

    Automated exception search integrated into your IDE

  4. 0

    I/O error reading PNG header

    Stack Overflow | 2 years ago
    javax.imageio.IIOException: I/O error reading PNG header!
  5. 0

    How to display BufferedImage using JPanel

    Oracle Community | 1 decade ago | 843804
    javax.imageio.IIOException: Can't get input stream from URL!

  1. serious2monkeys 3 times, last 4 months ago
  2. rexgreenza 10 times, last 5 months ago
  3. ptrstovka 2 times, last 10 months ago
16 unregistered visitors
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. javax.imageio.IIOException

    Bogus marker length

    at com.sun.imageio.plugins.jpeg.JPEGImageReader.readImageHeader()
  2. Java RT
    ImageIO.read
    1. com.sun.imageio.plugins.jpeg.JPEGImageReader.readImageHeader(Native Method)
    2. com.sun.imageio.plugins.jpeg.JPEGImageReader.readNativeHeader(JPEGImageReader.java:554)
    3. com.sun.imageio.plugins.jpeg.JPEGImageReader.checkTablesOnly(JPEGImageReader.java:309)
    4. com.sun.imageio.plugins.jpeg.JPEGImageReader.gotoImage(JPEGImageReader.java:431)
    5. com.sun.imageio.plugins.jpeg.JPEGImageReader.readHeader(JPEGImageReader.java:547)
    6. com.sun.imageio.plugins.jpeg.JPEGImageReader.readInternal(JPEGImageReader.java:880)
    7. com.sun.imageio.plugins.jpeg.JPEGImageReader.read(JPEGImageReader.java:864)
    8. javax.imageio.ImageIO.read(ImageIO.java:1384)
    9. javax.imageio.ImageIO.read(ImageIO.java:1270)
    9 frames
  3. Unknown
    JPGReaderReadAllTest.main
    1. JPGReaderReadAllTest.<init>(JPGReaderReadAllTest.java:34)
    2. JPGReaderReadAllTest.main(JPGReaderReadAllTest.java:50)
    2 frames