javax.imageio.IIOException: Bogus marker length

JDK Bug System | Praveen Mohan | 1 decade ago
  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

    How to display BufferedImage using JPanel

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

    Image Blender is failing to load the OverlayHook.png

    GitHub | 2 years ago | lordoku
    javax.imageio.IIOException: Can't read input file!
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Movie Maker throws Java Exception from files exported with saveFrame()

    GitHub | 3 years ago | ld26464
    javax.imageio.IIOException: Error reading PNG image data

  1. serious2monkeys 3 times, last 3 days ago
  2. rexgreenza 10 times, last 1 month ago
  3. ptrstovka 2 times, last 6 months ago
15 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