Package javax.imageio

Examples of javax.imageio.ImageReader.dispose()


                            ImageReader reader = (ImageReader) readers.next();
                            try {
                                reader.setInput(in);
                                image.setDimensions(reader.getWidth(0) + "x" + reader.getHeight(0));
                            } finally {
                                reader.dispose();
                            }
                        }
                        if (image.getDimensions() == null || image.getDimensions().equals("unknown")) {
                            throw new Exception();
                        }
View Full Code Here


                    metadata.set("height", Integer.toString(reader.getHeight(0)));
                    metadata.set("width", Integer.toString(reader.getWidth(0)));

                    loadMetadata(reader.getImageMetadata(0), metadata);

                    reader.dispose();
                }
               
                // Translate certain Metadata tags from the ImageIO
                //  specific namespace into the general Tika one
                setIfPresent(metadata, "CommentExtensions CommentExtension", Metadata.COMMENTS);
View Full Code Here

                    if (bufferedImage != null) {
                        return bufferedImage;
                    }
                } finally {
                    imageInputStream.close();
                    imageReader.dispose();
                }
            } catch (IOException e) {
                ioe = e;
                continue;
            }
View Full Code Here

                            }
                        }
                    }
                }
            }
            reader.dispose();
        }
    }

    private class MyListener extends MouseInputAdapter {
        private Point lastMousePress;
View Full Code Here

                        ImageReader reader = readers.next();
                        try {
                            reader.setInput(input);
                            return new Dimension(reader.getWidth(0), reader.getHeight(0));
                        } finally {
                            reader.dispose();
                        }
                    }
                } finally {
                    if (input != null) {
                        input.close();
View Full Code Here

                    if (dpi[1] == 0) dpi[1] = PIXEL_DPI;

                    size.width = img.getWidth()*PIXEL_DPI/dpi[0];
                    size.height = img.getHeight()*PIXEL_DPI/dpi[1];

                    r.dispose();
                    iis.close();

                } catch (IOException e){
                    //silently return if ImageIO failed to read the image
                    logger.log(POILogger.WARN, e);
View Full Code Here

                    if (bufferedImage != null) {
                        return bufferedImage;
                    }
                } finally {
                    imageInputStream.close();
                    imageReader.dispose();
                }
            } catch (IOException e) {
                ioe = e;
                continue;
            }
View Full Code Here

            ImageReader reader = iterator.next();
            try {
                reader.setInput(iis);
                return new int[] {reader.getWidth(0), reader.getHeight(0)};
            } finally {
                reader.dispose();
            }
        } finally {
            iis.close();
        }
    }
View Full Code Here

      reader.setInput(stream, true, true);
      String type = reader.getFormatName();
      setContentType(Type.getTypeByFormatName(type));
      bufferedImage = reader.read(0, param);
      stream.close();
      reader.dispose();
      dirty = true;
      inputStream.close();
   }
  
   private int getImageType() {
View Full Code Here

                    if (dpi[1] == 0) dpi[1] = PIXEL_DPI;

                    size.width = img.getWidth()*PIXEL_DPI/dpi[0];
                    size.height = img.getHeight()*PIXEL_DPI/dpi[1];

                    r.dispose();
                    iis.close();

                } catch (IOException e){
                    //silently return if ImageIO failed to read the image
                    logger.log(POILogger.WARN, e);
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.