Package javax.imageio

Examples of javax.imageio.ImageReader.dispose()


      if (iter.hasNext()) {
  ImageReader reader = iter.next();
  reader.setInput(iis);
  iImage = reader.read(0);
  iis.close();
  reader.dispose();
      } else {
  throw new IllegalStateException("no ImageReader for given format");
      }
    } else {
      throw new IllegalStateException("failed to create ImageInputStream");
View Full Code Here


                    ImageReader reader = iterator.next();
                    reader.setInput(ImageIO.createImageInputStream(
                            new CloseShieldInputStream(stream)));
                    metadata.set("height", Integer.toString(reader.getHeight(0)));
                    metadata.set("width", Integer.toString(reader.getWidth(0)));
                    reader.dispose();
                }
            } catch (IIOException e) {
                throw new TikaException(type + " parse error", e);
            }
        }
View Full Code Here

                                / Float.parseFloat(child.getAttribute("value"));
                    }
                }
            }
            imgStream.close();
            reader.dispose();
           
            this.height = imageData.getHeight();
            this.width = imageData.getWidth();

            ColorModel cm = imageData.getColorModel();
View Full Code Here

                    } catch (IIOException iioe) {
                        //ignore
                    }
                    imgStream.reset();
                } finally {
                    reader.dispose();
                }
            }
        } finally {
            ImageUtil.closeQuietly(src);
            //TODO Some codecs may do late reading.
View Full Code Here

                    ImageReader reader = iterator.next();
                    reader.setInput(ImageIO.createImageInputStream(
                            new CloseShieldInputStream(stream)));
                    metadata.set("height", Integer.toString(reader.getHeight(0)));
                    metadata.set("width", Integer.toString(reader.getWidth(0)));
                    reader.dispose();
                }
            } catch (IIOException e) {
                throw new TikaException(type + " parse error", e);
            }
        }
View Full Code Here

        {
            if (iis != null)
            {
                iis.close();
            }
            reader.dispose();
        }
        return new DecodeResult(parameters);
    }

    // reads the APP14 Adobe transform tag
View Full Code Here

        {
            if (iis != null)
            {
                iis.close();
            }
            reader.dispose();
        }

        // repair missing color space
        if (!parameters.containsKey(COSName.COLORSPACE))
        {
View Full Code Here

        {
            if (iis != null)
            {
                iis.close();
            }
            reader.dispose();
        }
    }

    @Override
    protected final void encode(InputStream input, OutputStream encoded, COSDictionary parameters)
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

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.