From 6997fa012131ea26e064c560c3a099a17d54a0d5 Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Wed, 19 Oct 2016 22:51:37 +0200 Subject: [PATCH] windowscodecs-GIF_Encoder: Update patchset. --- patches/patchinstall.sh | 8 ++- ...po-in-GIF-container-format-passed-to.patch | 35 ++++++++++ ...itialize-empty-property-bag-in-GIF-e.patch | 70 +++++++++++++++++++ 3 files changed, 111 insertions(+), 2 deletions(-) create mode 100644 patches/windowscodecs-GIF_Encoder/0009-gdiplus-Fix-a-typo-in-GIF-container-format-passed-to.patch create mode 100644 patches/windowscodecs-GIF_Encoder/0010-windowscodecs-Initialize-empty-property-bag-in-GIF-e.patch diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index 198520a1..97d9c371 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -7200,8 +7200,8 @@ fi # Patchset windowscodecs-GIF_Encoder # | # | Modified files: -# | * dlls/windowscodecs/bmpencode.c, dlls/windowscodecs/clsfactory.c, dlls/windowscodecs/gifformat.c, -# | dlls/windowscodecs/info.c, dlls/windowscodecs/jpegformat.c, dlls/windowscodecs/regsvr.c, +# | * dlls/gdiplus/image.c, dlls/gdiplus/tests/image.c, dlls/windowscodecs/bmpencode.c, dlls/windowscodecs/clsfactory.c, +# | dlls/windowscodecs/gifformat.c, dlls/windowscodecs/info.c, dlls/windowscodecs/jpegformat.c, dlls/windowscodecs/regsvr.c, # | dlls/windowscodecs/tiffformat.c, dlls/windowscodecs/wincodecs_private.h # | if test "$enable_windowscodecs_GIF_Encoder" -eq 1; then @@ -7213,6 +7213,8 @@ if test "$enable_windowscodecs_GIF_Encoder" -eq 1; then patch_apply windowscodecs-GIF_Encoder/0006-windowscodecs-Implement-IWICBitmapEncoder-GetEncoder.patch patch_apply windowscodecs-GIF_Encoder/0007-windowscodecs-Avoid-crashing-if-no-IPropertyBag2-was.patch patch_apply windowscodecs-GIF_Encoder/0008-windowscodecs-Add-initial-implementation-of-the-GIF-.patch + patch_apply windowscodecs-GIF_Encoder/0009-gdiplus-Fix-a-typo-in-GIF-container-format-passed-to.patch + patch_apply windowscodecs-GIF_Encoder/0010-windowscodecs-Initialize-empty-property-bag-in-GIF-e.patch ( echo '+ { "Dmitry Timoshkov", "windowscodecs: Implement IWICBitmapEncoder::GetEncoderInfo in BMP encoder.", 1 },'; echo '+ { "Dmitry Timoshkov", "windowscodecs: Implement IWICBitmapEncoderInfo::GetFileExtensions.", 1 },'; @@ -7222,6 +7224,8 @@ if test "$enable_windowscodecs_GIF_Encoder" -eq 1; then echo '+ { "Dmitry Timoshkov", "windowscodecs: Implement IWICBitmapEncoder::GetEncoderInfo in TIFF encoder.", 1 },'; echo '+ { "Dmitry Timoshkov", "windowscodecs: Avoid crashing if no IPropertyBag2 was passed to IWICBitmapEncoder::CreateNewFrame in TIFF encoder.", 1 },'; echo '+ { "Dmitry Timoshkov", "windowscodecs: Add initial implementation of the GIF encoder.", 1 },'; + echo '+ { "Dmitry Timoshkov", "gdiplus: Fix a typo in GIF container format passed to encode_image_wic().", 1 },'; + echo '+ { "Dmitry Timoshkov", "windowscodecs: Initialize empty property bag in GIF encoder'\''s CreateNewFrame implementation.", 1 },'; ) >> "$patchlist" fi diff --git a/patches/windowscodecs-GIF_Encoder/0009-gdiplus-Fix-a-typo-in-GIF-container-format-passed-to.patch b/patches/windowscodecs-GIF_Encoder/0009-gdiplus-Fix-a-typo-in-GIF-container-format-passed-to.patch new file mode 100644 index 00000000..56bbe705 --- /dev/null +++ b/patches/windowscodecs-GIF_Encoder/0009-gdiplus-Fix-a-typo-in-GIF-container-format-passed-to.patch @@ -0,0 +1,35 @@ +From bddc58a7a0c3bb53e46f107449c776b86e34aa80 Mon Sep 17 00:00:00 2001 +From: Dmitry Timoshkov +Date: Mon, 17 Oct 2016 15:23:39 +0800 +Subject: gdiplus: Fix a typo in GIF container format passed to + encode_image_wic(). + +--- + dlls/gdiplus/image.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/dlls/gdiplus/image.c b/dlls/gdiplus/image.c +index 74fad29..af87236 100644 +--- a/dlls/gdiplus/image.c ++++ b/dlls/gdiplus/image.c +@@ -4512,7 +4512,7 @@ static GpStatus encode_image_jpeg(GpImage *image, IStream* stream, + static GpStatus encode_image_gif(GpImage *image, IStream* stream, + GDIPCONST CLSID* clsid, GDIPCONST EncoderParameters* params) + { +- return encode_image_wic(image, stream, &CLSID_WICGifEncoder, params); ++ return encode_image_wic(image, stream, &GUID_ContainerFormatGif, params); + } + + /***************************************************************************** +@@ -4525,7 +4525,7 @@ GpStatus WINGDIPAPI GdipSaveImageToStream(GpImage *image, IStream* stream, + encode_image_func encode_image; + int i; + +- TRACE("%p %p %p %p\n", image, stream, clsid, params); ++ TRACE("%p %p %s %p\n", image, stream, wine_dbgstr_guid(clsid), params); + + if(!image || !stream) + return InvalidParameter; +-- +2.9.0 + diff --git a/patches/windowscodecs-GIF_Encoder/0010-windowscodecs-Initialize-empty-property-bag-in-GIF-e.patch b/patches/windowscodecs-GIF_Encoder/0010-windowscodecs-Initialize-empty-property-bag-in-GIF-e.patch new file mode 100644 index 00000000..53668d17 --- /dev/null +++ b/patches/windowscodecs-GIF_Encoder/0010-windowscodecs-Initialize-empty-property-bag-in-GIF-e.patch @@ -0,0 +1,70 @@ +From b71e5960bb9cc8926ab03d7c2abf70ad976f9732 Mon Sep 17 00:00:00 2001 +From: Dmitry Timoshkov +Date: Mon, 17 Oct 2016 15:27:47 +0800 +Subject: windowscodecs: Initialize empty property bag in GIF encoder's + CreateNewFrame implementation. + +gdiplus depends on IPropertyBag2 being initialized, otherwise it crashes. +--- + dlls/gdiplus/tests/image.c | 14 ++++++-------- + dlls/windowscodecs/gifformat.c | 10 ++++++++++ + 2 files changed, 16 insertions(+), 8 deletions(-) + +diff --git a/dlls/gdiplus/tests/image.c b/dlls/gdiplus/tests/image.c +index 8c123b9..8cbbb5b 100644 +--- a/dlls/gdiplus/tests/image.c ++++ b/dlls/gdiplus/tests/image.c +@@ -4637,14 +4637,13 @@ static void test_supported_encoders(void) + { + LPCWSTR mime; + const GUID *format; +- BOOL todo; + } td[] = + { +- { bmp_mimetype, &ImageFormatBMP, FALSE }, +- { jpeg_mimetype, &ImageFormatJPEG, FALSE }, +- { gif_mimetype, &ImageFormatGIF, TRUE }, +- { tiff_mimetype, &ImageFormatTIFF, FALSE }, +- { png_mimetype, &ImageFormatPNG, FALSE } ++ { bmp_mimetype, &ImageFormatBMP }, ++ { jpeg_mimetype, &ImageFormatJPEG }, ++ { gif_mimetype, &ImageFormatGIF }, ++ { tiff_mimetype, &ImageFormatTIFF }, ++ { png_mimetype, &ImageFormatPNG } + }; + GUID format, clsid; + BOOL ret; +@@ -4670,8 +4669,7 @@ static void test_supported_encoders(void) + ok(hr == S_OK, "CreateStreamOnHGlobal error %#x\n", hr); + + status = GdipSaveImageToStream((GpImage *)bm, stream, &clsid, NULL); +- todo_wine_if (td[i].todo) +- ok(status == Ok, "GdipSaveImageToStream error %d\n", status); ++ ok(status == Ok, "GdipSaveImageToStream error %d\n", status); + + IStream_Release(stream); + } +diff --git a/dlls/windowscodecs/gifformat.c b/dlls/windowscodecs/gifformat.c +index b5c56aa..6052726 100644 +--- a/dlls/windowscodecs/gifformat.c ++++ b/dlls/windowscodecs/gifformat.c +@@ -2296,6 +2296,16 @@ static HRESULT WINAPI GifEncoder_CreateNewFrame(IWICBitmapEncoder *iface, IWICBi + *frame = &ret->IWICBitmapFrameEncode_iface; + + hr = S_OK; ++ ++ if (options) ++ { ++ hr = CreatePropertyBag2(NULL, 0, options); ++ if (hr != S_OK) ++ { ++ IWICBitmapFrameEncode_Release(*frame); ++ *frame = NULL; ++ } ++ } + } + else + hr = E_OUTOFMEMORY; +-- +2.9.0 +