http://bugs.winehq.org/show_bug.cgi?id=14196
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |focht@gmx.net
--- Comment #3 from Anastasius Focht focht@gmx.net 2008-06-30 16:12:32 --- Hello,
the bug is in gdiplus returning incorrect pixel format when loading a .gif file as bitmap.
--- snip wine trace --- .. 005b:Call gdiplus.GdipCreateBitmapFromFile(34724790 L"Z:\home\focht\work\eclipse\plugins\org.eclipse.platform_3.3.100.v200806172000\eclipse.gif",0032f154) ret=34cb12dd .. 005b:Call oleaut32.OleLoadPicture(0015c5b0,00000000,00000000,612168a4,0032f064) ret=6120e161 005b:trace:ole:OleLoadPicture (0x15c5b0,0,0,{7bf80980-bf32-101a-8bbb-00aa00300cab},0x32f064), partially implemented. 005b:trace:ole:OleCreatePictureIndirect ((nil),{7bf80980-bf32-101a-8bbb-00aa00300cab},1,0x32ef54) .. 005b:trace:ole:OLEPictureImpl_LoadGif screen height 16, width 16 005b:trace:ole:OLEPictureImpl_LoadGif color res 8, backgcolor 155 005b:trace:ole:OLEPictureImpl_LoadGif imgcnt 1 005b:trace:ole:OLEPictureImpl_LoadGif curimage: 16 x 16, on 0x0, interlace 0 .. 005b:Ret oleaut32.OleLoadPicture() retval=00000000 ret=6120e161 005b:trace:ole:OLEPictureImpl_get_Type (0x15c690)->(0x32f06a): type is 1 .. 005b:trace:ole:OLEPictureImpl_get_Width (0x15c690)->(0x32eff0): width is 423 .. 005b:trace:ole:OLEPictureImpl_get_Height (0x15c690)->(0x32eff0): height is 423 .. 005b:Ret gdiplus.GdipCreateBitmapFromFile() retval=00000000 ret=34cb12dd .. 005b:Call gdiplus.GdipGetImageWidth(00158b90,0032f180) ret=34cb2bdb 005b:trace:gdiplus:GdipGetImageWidth returning 16 005b:Ret gdiplus.GdipGetImageWidth() retval=00000000 ret=34cb2bdb .. 005b:Call gdiplus.GdipGetImageHeight(00158b90,0032f180) ret=34cb2b27 005b:trace:gdiplus:GdipGetImageHeight returning 16 005b:Ret gdiplus.GdipGetImageHeight() retval=00000000 ret=34cb2b27 .. 005b:Call gdiplus.GdipGetImagePixelFormat(00158b90,0032f198) ret=34cb2ba9 005b:Ret gdiplus.GdipGetImagePixelFormat() retval=00000000 ret=34cb2ba9 .. 005b:Call KERNEL32.GetProcAddress(34cb0000,34665308 "_Java_org_eclipse_swt_internal_gdip_Gdip_BitmapData_1new@8") ret=6d27116a 005b:Ret KERNEL32.GetProcAddress() retval=34cb1000 ret=6d27116a .. 005b:Call KERNEL32.GetProcAddress(34cb0000,34665308 "_Java_org_eclipse_swt_internal_gdip_Gdip_Bitmap_1LockBits@28") ret=6d27116a 005b:Ret KERNEL32.GetProcAddress() retval=34cb10d0 ret=6d27116a .. 005b:Call gdiplus.GdipBitmapLockBits(00158b90,00000000,00000000,00022000,34de0250) ret=34cb10eb 005b:trace:gdiplus:GdipBitmapLockBits 0x158b90 (nil) 0 139264 0x34de0250 .. 005b:Ret gdiplus.GdipBitmapLockBits() retval=00000000 ret=34cb10eb .. 005b:Call KERNEL32.GetProcAddress(34cb0000,34724790 "_Java_org_eclipse_swt_internal_gdip_Gdip_MoveMemory@16") ret=6d27116a 005b:Ret KERNEL32.GetProcAddress() retval=00000000 ret=6d27116a .. 005b:Call KERNEL32.GetProcAddress(34cb0000,34724790 "_Java_org_eclipse_swt_internal_gdip_Gdip_Bitmap_1delete@12") ret=6d27116a 005b:Ret KERNEL32.GetProcAddress() retval=34cb111b ret=6d27116a .. 005b:Call gdiplus.GdipDisposeImage(00158b90) ret=34cb11b8 .. 005b:Ret gdiplus.GdipDisposeImage() retval=00000000 ret=34cb11b8 005b:Call gdiplus.GdipFree(00158570) ret=34cb11c5 .. 005b:Ret gdiplus.GdipFree() retval=00000001 ret=34cb11c5 .. --- snip wine trace ---
--- snip dlls/gdiplus/image.c ---
/* FIXME: test this function for non-bitmap types */ GpStatus WINGDIPAPI GdipGetImagePixelFormat(GpImage *image, PixelFormat *format) { if(!image || !format) return InvalidParameter;
if(image->type != ImageTypeBitmap) *format = PixelFormat24bppRGB; else *format = ((GpBitmap*) image)->format;
return Ok; }
--- snip dlls/gdiplus/image.c ---
Eclipse tries to load .gif with it's gdiplus wrapper.
Wine's GdipGetImagePixelFormat() returns 0x22000 format value which is incorrect. Eclipse wrapper doesn't know about this format because it looks for standard gdiplus pixelformat values as defined in "GdiPlusPixelFormats.h".
This value is set in GdipLoadImageFromStream():
(*((GpBitmap**) image))->format = (bmch->bcBitCount << 8) | PixelFormatGDI;
If you look at "GdiPlusPixelFormats.h" every Pixelformat value has an enumerator-like id prepended, e.g.:
<enumerator_id> | (bitcount << 8) | <additional format flags>
This has to be taken into account.
---
As temporary workaround, use 'sh winetricks gdiplus' until this is fixed.
Regards