private RasterFormatTag rasterFormatTag = null;
private static final ImageLayout layoutHelper (ImageLayout layout,
Image image) {
/* Determine image width and height using MediaTracker. */
MediaTracker tracker = new MediaTracker(new Canvas());
tracker.addImage(image, 0);
try {
tracker.waitForID(0);
} catch (InterruptedException e) {
e.printStackTrace();
throw new RuntimeException(JaiI18N.getString("AWTImageOpImage0"));
}
if (tracker.isErrorID(0)) { // not standard file format
throw new RuntimeException(JaiI18N.getString("AWTImageOpImage1"));
}
tracker.removeImage(image);
// Create layout if none supplied.
if(layout == null) layout = new ImageLayout();
// Override minX, minY, width, height