Commit ed2d0df4 authored by Vincent Povirk's avatar Vincent Povirk Committed by Alexandre Julliard

gdiplus: Don't set a palette when loading non-indexed images.

parent c4ef9874
......@@ -58,11 +58,11 @@ static const struct
{ &GUID_WICPixelFormat4bppIndexed, PixelFormat4bppIndexed, WICBitmapPaletteTypeFixedHalftone8 },
{ &GUID_WICPixelFormat8bppIndexed, PixelFormat8bppIndexed, WICBitmapPaletteTypeFixedHalftone256 },
{ &GUID_WICPixelFormat8bppGray, PixelFormat8bppIndexed, WICBitmapPaletteTypeFixedGray256 },
{ &GUID_WICPixelFormat16bppBGR555, PixelFormat16bppRGB555, WICBitmapPaletteTypeFixedHalftone256 },
{ &GUID_WICPixelFormat24bppBGR, PixelFormat24bppRGB, WICBitmapPaletteTypeFixedHalftone256 },
{ &GUID_WICPixelFormat32bppBGR, PixelFormat32bppRGB, WICBitmapPaletteTypeFixedHalftone256 },
{ &GUID_WICPixelFormat32bppBGRA, PixelFormat32bppARGB, WICBitmapPaletteTypeFixedHalftone256 },
{ &GUID_WICPixelFormat32bppPBGRA, PixelFormat32bppPARGB, WICBitmapPaletteTypeFixedHalftone256 },
{ &GUID_WICPixelFormat16bppBGR555, PixelFormat16bppRGB555, 0 },
{ &GUID_WICPixelFormat24bppBGR, PixelFormat24bppRGB, 0 },
{ &GUID_WICPixelFormat32bppBGR, PixelFormat32bppRGB, 0 },
{ &GUID_WICPixelFormat32bppBGRA, PixelFormat32bppARGB, 0 },
{ &GUID_WICPixelFormat32bppPBGRA, PixelFormat32bppPARGB, 0 },
{ NULL }
};
......@@ -82,7 +82,7 @@ static ColorPalette *get_palette(IWICBitmapFrameDecode *frame, WICBitmapPaletteT
hr = WINCODEC_ERR_PALETTEUNAVAILABLE;
if (frame)
hr = IWICBitmapFrameDecode_CopyPalette(frame, wic_palette);
if (hr != S_OK)
if (hr != S_OK && palette_type != 0)
{
TRACE("using predefined palette %#x\n", palette_type);
hr = IWICPalette_InitializePredefined(wic_palette, palette_type, FALSE);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment