Package javax.imageio

Examples of javax.imageio.ImageReader.dispose()


        }
        ImageInputStream iis = ImageIO.createImageInputStream(compressedData);
        reader.setInput(iis);
        BufferedImage bi = reader.read(0);
        iis.close();
        reader.dispose();
        if ( bi != null )
        {
            // I am assuming since JBIG2 is always black and white
            // depending on your renderer this might or might be needed
            if(bi.getColorModel().getPixelSize() != bits.intValue())
View Full Code Here


        val = pixelSizeNode.getAttributes().getNamedItem("value").getNodeValue();
        actualResolution = (int) Math.round(25.4 / Double.parseDouble(val));
        assertEquals("Y resolution doesn't match", expectedResolution, actualResolution);

        iis.close();
        reader.dispose();
    }

    /**
     * checks whether the resolution of a BMP image file is as expected.
     *
 
View Full Code Here

        Element comprElement = (Element) root.getElementsByTagName("Compression").item(0);
        Node comprTypeNode = comprElement.getElementsByTagName("CompressionTypeName").item(0);
        String actualCompression = comprTypeNode.getAttributes().getNamedItem("value").getNodeValue();
        assertEquals("Incorrect TIFF compression in file " + filename, expectedCompression, actualCompression);
        iis.close();
        reader.dispose();
    }

}
View Full Code Here

        document = PDDocument.loadNonSeq(new File(testResultsDir, "multitiff.pdf"), null);
        List pages = document.getDocumentCatalog().getAllPages();
        assertEquals(countTiffImages, pages.size());
       
        document.close()
        imageReader.dispose();
    }
   
}
View Full Code Here

        result.height = currentReader.getHeight(0);
        iis.close();
      } catch (IOException ex) {
        log.warn("IOException", ex);
      }
      currentReader.dispose();
      return result;
    }
    return null;
  }
View Full Code Here

            {
                // swallow the exception
            }
            if (reader != null)
            {
                reader.dispose();
            }
        }
        return transformType;
    }
   
View Full Code Here

        // avoid to access the meta information
        ImageReader reader = (ImageReader) readers.next();
        reader.setInput(input);
        Raster raster = reader.readRaster(0, reader.getDefaultReadParam());
        input.close();
        reader.dispose();
        return raster;
    }

    // CMYK jpegs are not supported by JAI, so that we have to do the conversion on our own
    private BufferedImage convertCMYK2RGB(Raster raster, PDColorSpace colorspace) throws IOException
View Full Code Here

                int height = reader.getHeight(reader.getMinIndex());
                result = new Dimension(width, height);
            } catch (IOException e) {
                log(path + ": " + e.getMessage());
            } finally {
                reader.dispose();
            }
        }
        return result;
    }
View Full Code Here

        }

        image.setData(rgbRaster);
      }

      iir.dispose();
      iin.close();
      in.close();

      //image=cleanupImage(image,pX,pY);
      //image= ColorSpaceConvertor.convertToRGB(image);
View Full Code Here

            return img;
        } catch (Exception e) {
            throw new SimpleImageException(e);
        } finally {
            if(reader != null){
                reader.dispose();
            }
        }
    }

    public static ImageWrapper readGeneral(InputStream input)
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.