From: yaoyongjie <yaoyongjie@uniontech.com> Change-Id: I4dca5a2b5d1f913b71421dd932036f87dd0c82de --- dlls/gdiplus/image.c | 5 +++++ dlls/gdiplus/tests/image.c | 11 +++++------ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/dlls/gdiplus/image.c b/dlls/gdiplus/image.c index 17e1437eb5f..f764e523579 100644 --- a/dlls/gdiplus/image.c +++ b/dlls/gdiplus/image.c @@ -608,6 +608,11 @@ GpStatus convert_pixels(INT width, INT height, return Ok; } + /* gdiplus rejectes CMYK convertion on Win7 and WIN11 */ + if (src_format == PixelFormat32bppCMYK || dst_format == PixelFormat32bppCMYK || + src_format == PixelFormat16bppGrayScale || dst_format == PixelFormat16bppGrayScale) + return InvalidParameter; + #define convert_indexed_to_rgb(getpixel_function, setpixel_function) do { \ for (y=0; y<height; y++) \ for (x=0; x<width; x++) { \ diff --git a/dlls/gdiplus/tests/image.c b/dlls/gdiplus/tests/image.c index 7bbfeb3f986..796fb057676 100644 --- a/dlls/gdiplus/tests/image.c +++ b/dlls/gdiplus/tests/image.c @@ -4970,7 +4970,7 @@ static void test_image_format(void) status = GdipCreateHBITMAPFromBitmap(bitmap, &hbitmap, 0); if (fmt[i] == PixelFormat16bppGrayScale || fmt[i] == PixelFormat32bppCMYK) - todo_wine expect(InvalidParameter, status); + expect(InvalidParameter, status); else { expect(Ok, status); @@ -5004,7 +5004,7 @@ static void test_image_format(void) status = GdipBitmapLockBits(bitmap, NULL, ImageLockModeRead, PixelFormat32bppPARGB, &data); if (fmt[i] == PixelFormat16bppGrayScale || fmt[i] == PixelFormat32bppCMYK) - todo_wine expect(InvalidParameter, status); + expect(InvalidParameter, status); else { expect(Ok, status); @@ -5506,15 +5506,15 @@ static void test_CMYK_conversion(void) memset(&data, 0, sizeof(data)); status = GdipBitmapLockBits(bitmap, NULL, ImageLockModeRead, PixelFormat32bppARGB, &data); - todo_wine ok(status == InvalidParameter, "gdiplus rejectes PixelFormat32bppCMYK -> PixelFormat32bppARGB\n"); + ok(status == InvalidParameter, "gdiplus rejectes PixelFormat32bppCMYK -> PixelFormat32bppARGB\n"); status = GdipBitmapLockBits(bitmap, NULL, ImageLockModeRead, PixelFormat8bppIndexed, &data); - todo_wine ok(status == InvalidParameter, "gdiplus rejectes PixelFormat32bppCMYK -> PixelFormat8bppIndexed\n"); + ok(status == InvalidParameter, "gdiplus rejectes PixelFormat32bppCMYK -> PixelFormat8bppIndexed\n"); status = GdipBitmapLockBits(bitmap, NULL, ImageLockModeRead, PixelFormat16bppGrayScale, &data); - todo_wine ok(status == InvalidParameter, "gdiplus rejectes PixelFormat32bppCMYK -> PixelFormat16bppGrayScale\n"); + ok(status == InvalidParameter, "gdiplus rejectes PixelFormat32bppCMYK -> PixelFormat16bppGrayScale\n"); GdipDisposeImage((GpImage *)bitmap); } @@ -6260,7 +6260,6 @@ static void test_png_save_palette(void) status = GdipSaveImageToStream((GpImage *)bitmap, stream, &clsid, NULL); GdipDisposeImage((GpImage*)bitmap); - todo_wine_if(formats[i] == PixelFormat16bppGrayScale) ok(formats[i] == PixelFormat16bppGrayScale ? (status == GenericError || status == Win32Error) : status == Ok, "Unexpected return value %d saving image for PixelFormat %#x\n", status, formats[i]); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10835