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);
}
}