jai-imageio-core
  1. jai-imageio-core
  2. JAI_IMAGEIO_CORE-64

Loading JPEG2000 with destination image leave it blank

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Blocker Blocker
    • Resolution: Unresolved
    • Affects Version/s: 1.1-beta
    • Fix Version/s: milestone 1
    • Component/s: implementation
    • Labels:
      None
    • Environment:

      Operating System: Windows XP
      Platform: PC

    • Issuezilla Id:
      64

      Description

      I tried to load JPEG2000 files providing the reader with a destination
      BufferedImage in the ImageReadParam object but what I'm obtaining is an empty
      image.
      I tested that with realease 1.0_01 and the 1.1-dr-b01 with the same result.
      Here is the excerpt of the code:

      iis = ImageIO.createImageInputStream(file);
      Iterator<ImageReader> ti = ImageIO.getImageReaders(iis);
      if (ti.hasNext()) {
      ImageReader rdr = ti.next();
      rdr.setInput(iis);
      int min = rdr.getMinIndex();
      while (true) {
      try

      { ImageTypeSpecifier spec = rdr.getImageTypes(min).next(); int width = rdr.getWidth(min); int height = rdr.getHeight(min); BufferedImage img = spec.createBufferedImage(width, height); ImageReadParam pars = rdr.getDefaultReadParam(); pars.setDestination(img); BufferedImage img2 = rdr.read(min, pars); panel.add(new ImageComponent(img)); panel.add(new ImageComponent(img2)); min++; }

      catch (IndexOutOfBoundsException e)

      { break; }

      }
      }

      In the above code I would expect to have the same content in img and img2; I
      actually would expect that img == img1 but this is not the case.

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            jai-imageio-core-issues
            Reporter:
            alienisty
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated: