javax.imageio.IIOException: Bogus marker length

JDK Bug System | Praveen Mohan | 1 decade ago
Click on the to mark the solution that helps you, Samebug will learn from it.
As a community member, you’ll be rewarded for you help.
  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, 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( at com.sun.imageio.plugins.jpeg.JPEGImageReader.checkTablesOnly( at com.sun.imageio.plugins.jpeg.JPEGImageReader.gotoImage( at com.sun.imageio.plugins.jpeg.JPEGImageReader.readHeader( at com.sun.imageio.plugins.jpeg.JPEGImageReader.readInternal( at at at at JPGReaderReadAllTest.<init>( at JPGReaderReadAllTest.main(

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

    Null Pointer Exception when JPEG has got two SOI markers.

    GitHub | 3 years ago | dhirenpratap
    javax.imageio.IIOException: Invalid JPEG file structure: two SOI markers
  3. 0

    Reading picture from byte array

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

    Automated exception search integrated into your IDE

  5. 0

    I/O error reading PNG header

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

  1. serious2monkeys 3 times, last 6 months ago
  2. rexgreenza 10 times, last 7 months ago
  3. ptrstovka 2 times, last 1 year 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
    1. com.sun.imageio.plugins.jpeg.JPEGImageReader.readImageHeader(Native Method)
    2. com.sun.imageio.plugins.jpeg.JPEGImageReader.readNativeHeader(
    3. com.sun.imageio.plugins.jpeg.JPEGImageReader.checkTablesOnly(
    4. com.sun.imageio.plugins.jpeg.JPEGImageReader.gotoImage(
    5. com.sun.imageio.plugins.jpeg.JPEGImageReader.readHeader(
    6. com.sun.imageio.plugins.jpeg.JPEGImageReader.readInternal(
    9 frames
  3. Unknown
    1. JPGReaderReadAllTest.<init>(
    2. JPGReaderReadAllTest.main(
    2 frames