Re: [PATCH 3/3] windowscodecs: Use source palette if it wasn't specified earlier for PNG frame
Nikolay Sivov <nsivov(a)codeweavers.com> wrote:
@@ -1765,6 +1765,18 @@ static HRESULT WINAPI PngFrameEncode_WriteSource(IWICBitmapFrameEncode *iface,
if (SUCCEEDED(hr)) { + if (This->colors == 0) + { + IWICPalette *palette; + + if (SUCCEEDED(PaletteImpl_Create(&palette))) + { + if (SUCCEEDED(IWICBitmapSource_CopyPalette(pIBitmapSource, palette))) + IWICBitmapFrameEncode_SetPalette(iface, palette); + IWICPalette_Release(palette); + } + } + hr = write_source(iface, pIBitmapSource, prc, This->format->guid, This->format->bpp, This->width, This->height); }
What is this for? It looks like a workaround for a WIC converter bug. I'd like to see a test case for this behaviour. -- Dmitry.
participants (1)
-
Dmitry Timoshkov