handle 32bpp images
authorAlexandre Pigolkine <pigolkine@mono-cvs.ximian.com>
Sun, 29 Jun 2003 22:19:16 +0000 (22:19 -0000)
committerAlexandre Pigolkine <pigolkine@mono-cvs.ximian.com>
Sun, 29 Jun 2003 22:19:16 +0000 (22:19 -0000)
svn path=/trunk/mcs/; revision=15729

mcs/class/System.Drawing/System.Drawing.Imaging/BmpCodec.cs
mcs/class/System.Drawing/System.Drawing.Imaging/ChangeLog
mcs/class/System.Drawing/System.Drawing.Imaging/JPEGCodec.cs

index f5f70777317c01f0f218e5851c38afef8b0c49b2..5c5a4dbd4d955b1ab9d42f8d05e2ff6099286cd4 100644 (file)
@@ -222,6 +222,16 @@ namespace System.Drawing.Imaging {
                                else {
                                }
                                break;
+                               case 32:
+                               info.Format = PixelFormat.Format32bppArgb;
+                               if (bmfh.bfOffBits != 0L) stream.Seek (startPosition + bmfh.bfOffBits,SeekOrigin.Begin);
+                               if (bmih.biCompression == (uint)BitmapCompression.BI_RGB) {
+                                       info.RawImageBytes = new byte[bmih.biSizeImage];
+                                       stream.Read(info.RawImageBytes, 0, (int)bmih.biSizeImage);
+                               }
+                               else {
+                               }
+                               break;
                                default:
                                        throw new NotImplementedException(String.Format("This format is not yet supported : {0} bpp", bmih.biBitCount));
                                break;
index e61f50c230ab2bb24f1992ea73d5461d92f6d83b..a4422af5b5f883ff0eea7dc1f926c874a0dcb7f1 100644 (file)
@@ -1,3 +1,7 @@
+2003-06-29 Alexandre Pigolkine
+       * BmpCodec.cs           handle 32bpp images
+       * JPEGCodec.cs          small fix
+
 2003-06-27 Alexandre Pigolkine <pigolkine@gmx.de>
        * JPEGCodec.cs  encode 32 bpp images
 
index d037b9ed721ccabb85c4b112d9be980ef50ef3da..28ba5adcaab11e5920acfd33dffbd2a934cccf64 100644 (file)
@@ -153,7 +153,9 @@ namespace System.Drawing.Imaging
                                                break;
                                        }
                                }
-                               if (!structureFound) throw new Exception("JPEG Codec cannot work with existing libjpeg");
+                               if (!structureFound){
+                                       throw new Exception(String.Format("JPEG Codec cannot work with existing libjpeg.Structure size {0}.", size));
+                               }
                        }
 
                        public byte[] raw_struct {