Signed-off-by: Alistair Leslie-Hughes leslie_alistair@hotmail.com --- dlls/windowscodecs/converter.c | 2 +- dlls/windowscodecs/tests/converter.c | 34 ++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 1 deletion(-)
diff --git a/dlls/windowscodecs/converter.c b/dlls/windowscodecs/converter.c index c321627885b..b27d478f717 100644 --- a/dlls/windowscodecs/converter.c +++ b/dlls/windowscodecs/converter.c @@ -1703,7 +1703,7 @@ static HRESULT WINAPI FormatConverter_Initialize(IWICFormatConverter *iface, case WICBitmapPaletteTypeCustom: IWICPalette_Release(palette); palette = NULL; - if (bpp <= 8) return E_INVALIDARG; + if (bpp < 8) return E_INVALIDARG; break;
case WICBitmapPaletteTypeMedianCut: diff --git a/dlls/windowscodecs/tests/converter.c b/dlls/windowscodecs/tests/converter.c index df6528afa71..456b3502c77 100644 --- a/dlls/windowscodecs/tests/converter.c +++ b/dlls/windowscodecs/tests/converter.c @@ -637,6 +637,39 @@ static void test_default_converter(void) DeleteTestBitmap(src_obj); }
+static void test_converter_8bppGray(void) +{ + BitmapTestSrc *src_obj; + IWICFormatConverter *converter; + BOOL can_convert = TRUE; + HRESULT hr; + + CreateTestBitmap(&testdata_32bppBGRA, &src_obj); + + hr = CoCreateInstance(&CLSID_WICDefaultFormatConverter, NULL, CLSCTX_INPROC_SERVER, + &IID_IWICFormatConverter, (void**)&converter); + ok(SUCCEEDED(hr), "CoCreateInstance failed, hr=%x\n", hr); + if (SUCCEEDED(hr)) + { + hr = IWICFormatConverter_CanConvert(converter, &GUID_WICPixelFormat32bppBGRA, + &GUID_WICPixelFormat8bppGray, &can_convert); + ok(SUCCEEDED(hr), "CanConvert returned %x\n", hr); + ok(can_convert, "expected TRUE, got %i\n", can_convert); + + hr = IWICFormatConverter_Initialize(converter, &src_obj->IWICBitmapSource_iface, + &GUID_WICPixelFormat8bppGray, WICBitmapDitherTypeNone, NULL, 0.0, + WICBitmapPaletteTypeCustom); + ok(SUCCEEDED(hr), "Initialize returned %x\n", hr); + + if (SUCCEEDED(hr)) + compare_bitmap_data(&testdata_32bppBGRA, &testdata_8bppGray, (IWICBitmapSource*)converter, "8bppGray converter"); + + IWICFormatConverter_Release(converter); + } + + DeleteTestBitmap(src_obj); +} + typedef struct property_opt_test_data { LPCOLESTR name; @@ -1922,6 +1955,7 @@ START_TEST(converter)
test_invalid_conversion(); test_default_converter(); + test_converter_8bppGray(); test_converter_8bppIndexed();
test_encoder(&testdata_8bppIndexed, &CLSID_WICGifEncoder,
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=108751
Your paranoid android.
=== debian11 (32 bit report) ===
windowscodecs: converter.c:1765: Test failed: unexpected error 0
=== debian11 (32 bit Arabic:Morocco report) ===
windowscodecs: converter.c:1765: Test failed: unexpected error 0
=== debian11 (32 bit German report) ===
windowscodecs: converter.c:1765: Test failed: unexpected error 0
=== debian11 (32 bit French report) ===
windowscodecs: converter.c:1765: Test failed: unexpected error 0
=== debian11 (32 bit Hebrew:Israel report) ===
windowscodecs: converter.c:1765: Test failed: unexpected error 0
=== debian11 (32 bit Hindi:India report) ===
windowscodecs: converter.c:1765: Test failed: unexpected error 0
=== debian11 (32 bit Japanese:Japan report) ===
windowscodecs: converter.c:1765: Test failed: unexpected error 0
=== debian11 (32 bit Chinese:China report) ===
windowscodecs: converter.c:1765: Test failed: unexpected error 0
=== debian11 (32 bit WoW report) ===
windowscodecs: converter.c:1765: Test failed: unexpected error 0
=== debian11 (64 bit WoW report) ===
windowscodecs: converter.c:1765: Test failed: unexpected error 0
Not caused by this patch.
On 21/2/22 18:42, Marvin wrote:
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=108751
Your paranoid android.
=== debian11 (32 bit report) ===
windowscodecs: converter.c:1765: Test failed: unexpected error 0
=== debian11 (32 bit Arabic:Morocco report) ===
windowscodecs: converter.c:1765: Test failed: unexpected error 0
=== debian11 (32 bit German report) ===
windowscodecs: converter.c:1765: Test failed: unexpected error 0
=== debian11 (32 bit French report) ===
windowscodecs: converter.c:1765: Test failed: unexpected error 0
=== debian11 (32 bit Hebrew:Israel report) ===
windowscodecs: converter.c:1765: Test failed: unexpected error 0
=== debian11 (32 bit Hindi:India report) ===
windowscodecs: converter.c:1765: Test failed: unexpected error 0
=== debian11 (32 bit Japanese:Japan report) ===
windowscodecs: converter.c:1765: Test failed: unexpected error 0
=== debian11 (32 bit Chinese:China report) ===
windowscodecs: converter.c:1765: Test failed: unexpected error 0
=== debian11 (32 bit WoW report) ===
windowscodecs: converter.c:1765: Test failed: unexpected error 0
=== debian11 (64 bit WoW report) ===
windowscodecs: converter.c:1765: Test failed: unexpected error 0
On 2/21/22 13:11, Alistair Leslie-Hughes wrote:
Not caused by this patch.
I think it is. Tests pass for me without this patch, and show same failure as testbot with it.