From 00540ae7b99d632f8c41c13d73a160227c071e0d Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Sat, 26 Aug 2017 01:02:52 +0200 Subject: [PATCH] Rebase against 083e61fddf90ade32a119d5b6bf84d27adefc589. --- ...nversion-of-8-bpp-grayscale-PNG-imag.patch | 69 ------------------- patches/patchinstall.sh | 4 +- 2 files changed, 1 insertion(+), 72 deletions(-) delete mode 100644 patches/gdiplus-Grayscale_PNG/0003-gdiplus-Force-conversion-of-8-bpp-grayscale-PNG-imag.patch diff --git a/patches/gdiplus-Grayscale_PNG/0003-gdiplus-Force-conversion-of-8-bpp-grayscale-PNG-imag.patch b/patches/gdiplus-Grayscale_PNG/0003-gdiplus-Force-conversion-of-8-bpp-grayscale-PNG-imag.patch deleted file mode 100644 index f131b2ff..00000000 --- a/patches/gdiplus-Grayscale_PNG/0003-gdiplus-Force-conversion-of-8-bpp-grayscale-PNG-imag.patch +++ /dev/null @@ -1,69 +0,0 @@ -From c833d4e659d164dd69842d0c4deb39427a600fab Mon Sep 17 00:00:00 2001 -From: Dmitry Timoshkov -Date: Fri, 3 Jun 2016 13:47:06 +0800 -Subject: gdiplus: Force conversion of 8 bpp grayscale PNG images to 32 bpp - BGRA. - ---- - dlls/gdiplus/image.c | 32 +++++++++++++++++++++++++++++++- - dlls/gdiplus/tests/image.c | 1 - - 2 files changed, 31 insertions(+), 2 deletions(-) - -diff --git a/dlls/gdiplus/image.c b/dlls/gdiplus/image.c -index d1a5593..a8d8f2d 100644 ---- a/dlls/gdiplus/image.c -+++ b/dlls/gdiplus/image.c -@@ -3951,7 +3951,37 @@ static GpStatus decode_image_jpeg(IStream* stream, GpImage **image) - - static GpStatus decode_image_png(IStream* stream, GpImage **image) - { -- return decode_image_wic(stream, &GUID_ContainerFormatPng, png_metadata_reader, image); -+ IWICBitmapDecoder *decoder; -+ IWICBitmapFrameDecode *frame; -+ GpStatus status; -+ HRESULT hr; -+ GUID format; -+ BOOL force_conversion = FALSE; -+ -+ status = initialize_decoder_wic(stream, &GUID_ContainerFormatPng, &decoder); -+ if (status != Ok) -+ return status; -+ -+ hr = IWICBitmapDecoder_GetFrame(decoder, 0, &frame); -+ if (hr == S_OK) -+ { -+ hr = IWICBitmapFrameDecode_GetPixelFormat(frame, &format); -+ if (hr == S_OK) -+ { -+ if (IsEqualGUID(&format, &GUID_WICPixelFormat8bppGray)) -+ force_conversion = TRUE; -+ status = decode_frame_wic(decoder, force_conversion, 0, png_metadata_reader, image); -+ } -+ else -+ status = hresult_to_status(hr); -+ -+ IWICBitmapFrameDecode_Release(frame); -+ } -+ else -+ status = hresult_to_status(hr); -+ -+ IWICBitmapDecoder_Release(decoder); -+ return status; - } - - static GpStatus decode_image_gif(IStream* stream, GpImage **image) -diff --git a/dlls/gdiplus/tests/image.c b/dlls/gdiplus/tests/image.c -index 0c28c9e..b4682f7 100644 ---- a/dlls/gdiplus/tests/image.c -+++ b/dlls/gdiplus/tests/image.c -@@ -4773,7 +4773,6 @@ static void test_png_color_formats(void) - - status = GdipGetImagePixelFormat(image, &format); - expect(Ok, status); --todo_wine_if(td[i].bit_depth == 8 && td[i].color_type == 0) - ok(format == td[i].format || - broken(td[i].bit_depth == 1 && td[i].color_type == 0 && format == PixelFormat32bppARGB), /* XP */ - "%d: expected %#x, got %#x\n", i, td[i].format, format); --- -2.8.0 - diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index 0ef5ec52..8511072f 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -52,7 +52,7 @@ usage() # Get the upstream commit sha upstream_commit() { - echo "cc49c40f05a600327b80711f6f80844608dde366" + echo "083e61fddf90ade32a119d5b6bf84d27adefc589" } # Show version information @@ -4970,11 +4970,9 @@ fi # | * dlls/gdiplus/image.c, dlls/gdiplus/tests/image.c # | if test "$enable_gdiplus_Grayscale_PNG" -eq 1; then - patch_apply gdiplus-Grayscale_PNG/0003-gdiplus-Force-conversion-of-8-bpp-grayscale-PNG-imag.patch patch_apply gdiplus-Grayscale_PNG/0004-gdiplus-tests-Add-a-test-for-image-flags-to-PNG-gray.patch patch_apply gdiplus-Grayscale_PNG/0005-gdiplus-Set-correct-color-space-flags-for-grayscale-.patch ( - printf '%s\n' '+ { "Dmitry Timoshkov", "gdiplus: Force conversion of 8 bpp grayscale PNG images to 32 bpp BGRA.", 1 },'; printf '%s\n' '+ { "Dmitry Timoshkov", "gdiplus/tests: Add a test for image flags to PNG grayscale image tests.", 1 },'; printf '%s\n' '+ { "Dmitry Timoshkov", "gdiplus: Set correct color space flags for grayscale images.", 1 },'; ) >> "$patchlist"