Last patch for today :) (maybe...)

This one fixes a problem in our bmp writer, where the stream is closed
twice, resulting in an exception.

Once again, the full changelog for all the patchset follows (I'm going
to commit all together... Hey, we really want mercurial soon!!!).

Thanks,
Mario

2008-06-15  Mario Torre  <[EMAIL PROTECTED]>

* gnu/java/awt/java2d/AbstractGraphics2D.java (setColor): delegate to
setPaint.
(setPaint): fix to set paint context and foreground color.
(imageCache): new field.
(drawImage): new codepath for scaling images.
(prepareImage): new method.
(getPaintContext): set paintContext appropriately.
* gnu/java/awt/java2d/RasterGraphics.java (renderScanline): new method,
override from superclass to detect correct value of y while rendering
the scanline.
* gnu/java/awt/java2d/ScanlineConverter.java (renderShape): revert
previous
patch. 
* gnu/java/awt/peer/x/XEventPump.java (findMouseEventTarget): new
method.
(handleButtonPress): use of findMouseEventTarget to detect the correct
target.
(handleButtonRelease):  likewise.
* gnu/java/awt/peer/x/XGraphics2D.java (rawDrawImage): clip the target
image
so that it is completely contained in the destination pixmaps, as per
X11
specification.
* gnu/java/awt/peer/x/XToolkit.java (createTextField): method
implemented. 
(createButton): likewise.
(prepareImage): likewise.
(createLabel): likewise.
(checkImage): likewise.
(createTextArea): likewise.
(createCheckbox): likewise.
(checkHeadLess): new method.
* gnu/javax/imageio/bmp/BMPImageWriter.java (write):
don't close the stream.
* gnu/javax/imageio/bmp/BMPImageWriterSpi.java (names): added new names
to
the list of known names for BMP.
* java/awt/image/WritableRaster.java (createWritableTranslatedChild): 
* javax/imageio/ImageIO.java (write): call dispose on ImageWriter after
writing of the image.
### Eclipse Workspace Patch 1.0
#P classpath
Index: gnu/javax/imageio/bmp/BMPImageWriter.java
===================================================================
RCS file: /sources/classpath/classpath/gnu/javax/imageio/bmp/BMPImageWriter.java,v
retrieving revision 1.1
diff -u -r1.1 BMPImageWriter.java
--- gnu/javax/imageio/bmp/BMPImageWriter.java	20 Mar 2006 22:33:48 -0000	1.1
+++ gnu/javax/imageio/bmp/BMPImageWriter.java	15 Jun 2008 17:55:38 -0000
@@ -178,7 +178,6 @@
       encoder.encode(out, streamMetadata, image, param);
     else
       throw new BMPException("Encoder has not been initialized.");
-    out.close();
   }
   
   /**
Index: gnu/javax/imageio/bmp/BMPImageWriterSpi.java
===================================================================
RCS file: /sources/classpath/classpath/gnu/javax/imageio/bmp/BMPImageWriterSpi.java,v
retrieving revision 1.1
diff -u -r1.1 BMPImageWriterSpi.java
--- gnu/javax/imageio/bmp/BMPImageWriterSpi.java	20 Mar 2006 22:33:48 -0000	1.1
+++ gnu/javax/imageio/bmp/BMPImageWriterSpi.java	15 Jun 2008 17:55:38 -0000
@@ -51,7 +51,7 @@
   static final String vendorName = "GNU";
   static final String version = "0.1";
   static final String writerClassName = "gnu.javax.imageio.bmp.BMPImageWriter";
-  static final String[] names = { "Microsoft Windows BMP" };
+  static final String[] names = { "bmp", "BMP", "Microsoft Windows BMP" };
   static final String[] suffixes = { ".bmp", ".bm" };
   static final String[] MIMETypes = { "image/bmp", "image/x-windows-bmp" };
   static final String[] readerSpiNames = { "gnu.javax.imageio.bmp.BMPImageReaderSpi" };
Index: javax/imageio/ImageIO.java
===================================================================
RCS file: /sources/classpath/classpath/javax/imageio/ImageIO.java,v
retrieving revision 1.12
diff -u -r1.12 ImageIO.java
--- javax/imageio/ImageIO.java	10 Dec 2006 20:25:46 -0000	1.12
+++ javax/imageio/ImageIO.java	15 Jun 2008 17:55:39 -0000
@@ -851,6 +851,7 @@
           }
         
         w.write(null, img, null);
+        w.dispose();
         output.close();
         return true;
       }

Reply via email to