[Mono-bugs] [Bug 70681][Nor] Changed - libgdiplus is not endian aware

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Sun, 2 Jan 2005 02:44:22 -0500 (EST)


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by grompf@sublimeintervention.com.

http://bugzilla.ximian.com/show_bug.cgi?id=70681

--- shadow/70681	2005-01-02 02:41:09.000000000 -0500
+++ shadow/70681.tmp.27784	2005-01-02 02:44:22.000000000 -0500
@@ -27,6 +27,48 @@
 -kangaroo
 
 ------- Additional Comments From grompf@sublimeintervention.com  2005-01-02 02:41 -------
 Created an attachment (id=13618)
 patch
 
+
+------- Additional Comments From grompf@sublimeintervention.com  2005-01-02 02:44 -------
+This is an initial (yet incomplete) patch what is resolves is:
+
+BMP File output
+PNG File output
+
+jpg works internally;
+
+however there seems to be some palette / formatting problems with the data in Scan0;
+
+If I make a testcase like so:
+
+ Bitmap b = new Bitmap (500,500);
+                Graphics g = Graphics.FromImage (b);
+                g.FillRectangle (Brushes.White, 0, 0, 500, 500);
+                g.FillRectangle (Brushes.Red, 100, 100, 200, 200);
+                g.FillRectangle (Brushes.Green, 200, 200, 300, 300);
+                g.FillRectangle (Brushes.Blue, 300, 300, 400, 400);
+                b.Save ("output.bmp", System.Drawing.Imaging.ImageFormat.Bmp);
+                b.Save ("output.png", System.Drawing.Imaging.ImageFormat.Png);
+                b.Save ("output.jpg", System.Drawing.Imaging.ImageFormat.Jpeg);
+
+All 3 files are created properly but the palette/output is messed up; 
+
+but on the converse:
+Bitmap b = new Bitmap ("input.bmp");
+Graphics g = Graphics.FromImage (b);
+                g.FillRectangle (Brushes.Red, 100, 100, 200, 200);
+                b.Save ("output.bmp", System.Drawing.Imaging.ImageFormat.Bmp);
+
+The entire output is correct except for the Red brushed rectangle.
+
+It appears that we need to endian swap something in the internal Scan0 bytes; but only 
+stuff that we draw stuff read in is fine??
+
+Perhaps the read data is swapped incorrectly and should be swapped on the read?
+
+Thoughts from someone with some more graphics experience than i?
+
+-kangaroo
+