Module: wine Branch: master Commit: 3ece08ff4d3ee3f1ed2067ad53b77e8bc00f81e1 URL: http://source.winehq.org/git/wine.git/?a=commit;h=3ece08ff4d3ee3f1ed2067ad53...
Author: Piotr Caban piotr@codeweavers.com Date: Thu Mar 12 10:19:05 2015 +0100
gdiplus: Add pixel format test for transparent non-animated gif.
---
dlls/gdiplus/tests/image.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+)
diff --git a/dlls/gdiplus/tests/image.c b/dlls/gdiplus/tests/image.c index cc8ae2d..91f70b5 100644 --- a/dlls/gdiplus/tests/image.c +++ b/dlls/gdiplus/tests/image.c @@ -1335,6 +1335,12 @@ static const unsigned char gifimage[35] = { 0xff,0xff,0xff,0x2c,0x00,0x00,0x00,0x00,0x01,0x00,0x01,0x00,0x00,0x02,0x02,0x44, 0x01,0x00,0x3b }; +/* 1x1 pixel transparent gif */ +static const unsigned char transparentgif[] = { +0x47,0x49,0x46,0x38,0x39,0x61,0x01,0x00,0x01,0x00,0xf0,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x21,0xf9,0x04,0x01,0x00,0x00,0x00,0x00,0x2c,0x00,0x00,0x00,0x00, +0x01,0x00,0x01,0x00,0x00,0x02,0x02,0x44,0x01,0x00,0x3b +}; /* 1x1 pixel bmp */ static const unsigned char bmpimage[66] = { 0x42,0x4d,0x42,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3e,0x00,0x00,0x00,0x28,0x00, @@ -2621,6 +2627,30 @@ static void test_multiframegif(void) GdipDisposeImage((GpImage*)bmp); IStream_Release(stream);
+ /* Test with a non-animated transparent gif */ + hglob = GlobalAlloc (0, sizeof(transparentgif)); + data = GlobalLock (hglob); + memcpy(data, transparentgif, sizeof(transparentgif)); + GlobalUnlock(hglob); + + hres = CreateStreamOnHGlobal(hglob, TRUE, &stream); + ok(hres == S_OK, "Failed to create a stream\n"); + + stat = GdipCreateBitmapFromStream(stream, &bmp); + IStream_Release(stream); + ok(stat == Ok, "Failed to create a Bitmap\n"); + + stat = GdipGetImagePixelFormat((GpImage*)bmp, &pixel_format); + expect(Ok, stat); + expect(PixelFormat8bppIndexed, pixel_format); + + count = 12345; + stat = GdipImageGetFrameCount((GpImage*)bmp, &dimension, &count); + expect(Ok, stat); + expect(1, count); + + GdipDisposeImage((GpImage*)bmp); + /* Test frame dispose methods */ hglob = GlobalAlloc (0, sizeof(gifanimation2)); data = GlobalLock (hglob);