-
Bug
-
Resolution: Fixed
-
P4
-
5.0
-
1.4
-
b56
-
generic
-
solaris_9
This statement
// XXX - this makes a copy, which is memory-inefficient
srcRas = rimage.getData();
in JPEGImageWriter is really lame. If the source is a BufferedImage it is
going to copy the entire thing in memory. If it is an untiled JAI image this
should not happen (a child of the tile would be returned instead of copying).
Nonetheless I would suggest changing this to the code listed below. If a more
minor change would get in to the next build sooner then I would suggest this
instead:
srcRas = rimage instanceof BufferedImage ?
srcRas = ((BufferedImage)rimage).getRaster() :
rimage.getData();
which should solve most of the problem.
###@###.### 2005-05-06 20:43:42 GMT
// XXX - this makes a copy, which is memory-inefficient
srcRas = rimage.getData();
in JPEGImageWriter is really lame. If the source is a BufferedImage it is
going to copy the entire thing in memory. If it is an untiled JAI image this
should not happen (a child of the tile would be returned instead of copying).
Nonetheless I would suggest changing this to the code listed below. If a more
minor change would get in to the next build sooner then I would suggest this
instead:
srcRas = rimage instanceof BufferedImage ?
srcRas = ((BufferedImage)rimage).getRaster() :
rimage.getData();
which should solve most of the problem.
###@###.### 2005-05-06 20:43:42 GMT
- relates to
-
JDK-6268083 Core J2SE JPEG ImageWriter consumes much memory when writing
- Closed