EVALUATION
The "minor change" suggested in the description field is just what we have
currently in JPEGImageWriter, so perhaps the submitter was looking at an
old version of JPEGImageWriter. In any case, the full suggested fix would
probably help improve performance for simple RenderedImages, so it's still
worth pursuing.
|
SUGGESTED FIX
if(rimage instanceof BufferedImage) {
// Use the Raster directly.
srcRas = ((BufferedImage)rimage).getRaster();
} else if(rimage.getNumXTiles() == 1 &&
rimage.getNumYTiles() == 1) {
// Get the unique tile.
srcRas = rimage.getTile(rimage.getMinTileX(),
rimage.getMinTileY());
// Ensure the Raster has the dimensions of the image
// as the tile dimensions might differ.
if (srcRas.getWidth() != rimage.getWidth() ||
srcRas.getHeight() != rimage.getHeight()) {
srcRas = srcRas.createChild(srcRas.getMinX(),
srcRas.getMinY(),
rimage.getWidth(),
rimage.getHeight(),
srcRas.getMinX(),
srcRas.getMinY(),
null);
}
} else {
// Image is tiled so get a contiguous raster by copying.
srcRas = rimage.getData();
}
###@###.### 2005-05-06 20:43:43 GMT
|