Commit 8c593bd3 authored by Dmitry Timoshkov's avatar Dmitry Timoshkov Committed by Alexandre Julliard

gdiplus: Set correct color space flags for grayscale images.

parent 221c04d0
......@@ -3718,7 +3718,14 @@ static GpStatus decode_frame_wic(IWICBitmapDecoder *decoder, BOOL force_conversi
if (status == Ok)
{
/* Native GDI+ used to be smarter, but since Win7 it just sets these flags. */
bitmap->image.flags |= ImageFlagsReadOnly|ImageFlagsHasRealPixelSize|ImageFlagsHasRealDPI|ImageFlagsColorSpaceRGB;
bitmap->image.flags |= ImageFlagsReadOnly|ImageFlagsHasRealPixelSize|ImageFlagsHasRealDPI;
if (IsEqualGUID(&wic_format, &GUID_WICPixelFormat2bppGray) ||
IsEqualGUID(&wic_format, &GUID_WICPixelFormat4bppGray) ||
IsEqualGUID(&wic_format, &GUID_WICPixelFormat8bppGray) ||
IsEqualGUID(&wic_format, &GUID_WICPixelFormat16bppGray))
bitmap->image.flags |= ImageFlagsColorSpaceGRAY;
else
bitmap->image.flags |= ImageFlagsColorSpaceRGB;
bitmap->image.frame_count = frame_count;
bitmap->image.current_frame = active_frame;
bitmap->image.decoder = decoder;
......
......@@ -5022,7 +5022,6 @@ static void test_png_color_formats(void)
status = GdipGetImageFlags(image, &flags);
expect(Ok, status);
todo_wine_if(td[i].bit_depth > 1 && td[i].color_type == 0)
ok((flags & td[i].flags) == td[i].flags ||
broken(td[i].bit_depth == 1 && td[i].color_type == 0 && (flags & ImageFlagsColorSpaceGRAY)), /* XP */
"%d: expected %#x, got %#x\n", i, td[i].flags, flags);
......
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