[Mono-winforms-list] Weird issues reading pixels of jpg file on osx

Dan Shryock dan.shryock at gmail.com
Wed Aug 30 18:56:40 EDT 2006


When attempting to read the pixel bytes of a jpg on osx (using the
1.1.17 build just released) I am getting different results on windows
versus osx.  Does anybody have any ideas why I am getting these
different results?  Any information is very appreciated.

Dan


The code being used is as follows:

Bitmap bmp = new Bitmap("file.jpg");
BitmapData bmpdata = bmp.LockBits(new Rectangle(0,0,bmp.Width,
bmp.Height),ImageLockMode.ReadOnly,PixelFormat.Format24bppRgb);

unsafe{
	byte* scandata = (byte*) bmpdata.Scan0;
	for(int i=0; i<30; i++){
		Console.WriteLine(scandata[i]);
	}
}


and the results using mono on windows are:
187
144
77
187
144
77
186
144
75
188
143
75
188
144
73
189
145
74
192
147
74
192
147
74
192
150
75
191
149
74

while the results on osx are:
255
255
255
255
255
77
255
255
255
255
77
255
255
255
144
75
255
143
75
255
255
73
255
188
255
255
188
144
255
189


More information about the Mono-winforms-list mailing list