Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4929670

BMP/WBMP Readers fail to read from FileCacheIIS when executed from mapped drive

XMLWordPrintable

    • b26
    • x86
    • windows_xp
    • Verified

      I am creating a FileCacheImageInputStream out of a FileInputStream and a Cache directory. This FileInputStream encloses a BMP/WBMP image. I am passing this IIS to ImageIO.getImageReaders() method to fetch the correct ImageReader. I am getting BMP/WBMP reader depending on the image enclosed by FileInputStream. I invoked the canDecodeInput() method on the respective SPI class and it returned 'true'. When I tried to read the image from the IIS, BMP Reader throws a RuntimeException saying new BMP version is not yet implemented. WBMP ImageReader throws an IllegalArgException saying it is an empty region.

      I have specified the cache dir as 'cache' which falls on the same folder where this application is executed. One strange thing I have noticed is, when i run this application on solaris it works fine. When I map my home directory (/home/pm143956) onto a network drive in windows and run the application from the mapped drive, the application fails throwing the above mentioned exceptions. But when I run this application in C:\ of my PC, it works fine. I suspect there is some issue in the cache file creation which is giving this error especially when running from a mapped drive. However, this fails only for BMP/WBMP and JPEG continues to work fine regardless of whether it is 'C' drive or a mapped drive.

      I have attached a sample testcase alongwith some images. Save the application on your home directory in Solaris and map the home dir to a network drive in windows through Samba or an equivalent server. Execute the application and you would see the following exceptions in the console. But when you copy the same app to 'C' drive, the application will work fine.

      This is reproducible on all the builds that has BMP implementation. I tested this on Win XP.

      Here are the exceptions:
      BMP:
      java.lang.RuntimeException: New BMP version not implemented yet.
      at com.sun.imageio.plugins.bmp.BMPImageReader.readHeader(BMPImageReader.java:441)
      at com.sun.imageio.plugins.bmp.BMPImageReader.read(BMPImageReader.java:657)
      at javax.imageio.ImageReader.read(ImageReader.java:919)
      at ReaderStreamTest.<init>(ReaderStreamTest.java:48)
      at ReaderStreamTest.main(ReaderStreamTest.java:69)

      WBMP:
      java.lang.IllegalArgumentException: Empty region!
      at javax.imageio.ImageReader.computeRegions(ImageReader.java:2675)
      at com.sun.imageio.plugins.wbmp.WBMPImageReader.read(WBMPImageReader.java:183)
      at javax.imageio.ImageReader.read(ImageReader.java:919)
      at ReaderStreamTest.<init>(ReaderStreamTest.java:48)
      at ReaderStreamTest.main(ReaderStreamTest.java:69)

      In any case, the runtime exception shown above does not pinpoint the actual issue and the user will have no clue to debug this failure. It would be better if it is more meaningful.

            bae Andrew Brygin
            pmohansunw Praveen Mohan (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: