mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-06 23:42:06 +00:00
gdiplus: Set correct color space flags for grayscale images.
Signed-off-by: Vincent Povirk <vincent@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
221c04d0df
commit
8c593bd37a
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue