Example usage for javax.imageio ImageReader getImageMetadata

List of usage examples for javax.imageio ImageReader getImageMetadata

Introduction

In this page you can find the example usage for javax.imageio ImageReader getImageMetadata.

Prototype

public IIOMetadata getImageMetadata(int imageIndex, String formatName, Set<String> nodeNames)
        throws IOException 

Source Link

Document

Returns an IIOMetadata object representing the metadata associated with the given image, or null if the reader does not support reading metadata or none is available.

Usage

From source file:org.photovault.image.ImageIOImage.java

private void readImageMetadata(ImageReader reader) throws IOException {
    Set<String> nodes = new HashSet<String>();
    nodes.add("unknown");
    IIOMetadata iioMetadata = reader.getImageMetadata(0, "javax_imageio_jpeg_image_1.0", nodes);
    if (iioMetadata != null) {
        Node tree = iioMetadata.getAsTree("javax_imageio_jpeg_image_1.0");
        log.debug("read metadata: " + iioMetadata.toString());
        this.parseJPEGMetadata((IIOMetadataNode) tree);
    }//  w  w  w .ja v a  2  s. c o m
}