[Bug 59517] New: IWICFormatConverter does not support BlackWhite as destination pixel format
http://bugs.winehq.org/show_bug.cgi?id=59517 Bug ID: 59517 Summary: IWICFormatConverter does not support BlackWhite as destination pixel format Product: Wine Version: 11.4 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: windowscodecs Assignee: wine-bugs@list.winehq.org Reporter: Robert-Gerigk@online.de Distribution: --- Created attachment 80541 --> http://bugs.winehq.org/attachment.cgi?id=80541 test program IWICFormatConverter::Initialize() returns WINCODEC_ERR_UNSUPPORTEDOPERATION (0x88982F80) when GUID_WICPixelFormatBlackWhite is used as the destination pixel format. On Windows, this conversion succeeds for all source formats. This breaks .NET WPF applications that use System.Windows.Media.Imaging. FormatConvertedBitmap with PixelFormats.BlackWhite. The WPF imaging pipeline calls IWICFormatConverter internally, and the CLR maps the COM error to System.NotSupportedException ("The operation is not supported"). Steps to reproduce: 1. Create a 1bpp indexed BMP image (e.g., 8x8 checkerboard) 2. Load it via WPF BitmapImage (PixelFormat = Indexed1) 3. Create a FormatConvertedBitmap with DestinationFormat = BlackWhite 4. Call EndInit() on the FormatConvertedBitmap Expected: EndInit() succeeds, CopyPixels() returns valid 1bpp BlackWhite data Actual: EndInit() throws NotSupportedException (HRESULT 0x88982F80) Verified on: - Wine 11.4 (CachyOS/Arch, x86_64): FAIL - Tests 2+3 fail - Windows 11: PASS - all 4 tests pass Reproducer: The attached wic_format_test.cs is a minimal C# test program that creates an 8x8 1bpp BMP entirely in memory (no external files needed) and runs four tests: Test 1: Load 1bpp BMP via BitmapImage → PASS (Wine + Windows) Test 2: FormatConvertedBitmap → BlackWhite → FAIL on Wine, PASS on Windows Test 3: CopyPixels on converted bitmap → FAIL on Wine, PASS on Windows Test 4: FormatConvertedBitmap → Bgra32 (control) → PASS (Wine + Windows) Compile (Wine or Windows, .NET 4.x): csc.exe /r:PresentationCore.dll /r:WindowsBase.dll /r:System.Xaml.dll \ /target:exe /out:wic_format_test.exe wic_format_test.cs Run: wine wic_format_test.exe (or on Windows: wic_format_test.exe) Output is written to both console and wic_format_test.exe.log.txt. Root cause: In dlls/windowscodecs/converter.c, the supported_formats[] table entry for format_BlackWhite has NULL as the conversion function pointer: {format_BlackWhite, &GUID_WICPixelFormatBlackWhite, NULL}, This means no pixel format can be converted TO BlackWhite. Conversions FROM BlackWhite to other formats (e.g., 24bpp BGR, 8bpp Indexed) already work because those destination formats have their own copypixels_to_*() functions that handle format_BlackWhite as a source. A fix with Wine conformance tests will be submitted as a merge request. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
participants (1)
-
WineHQ Bugzilla