You've already forked wine-staging
mirror of
https://gitlab.winehq.org/wine/wine-staging.git
synced 2025-09-12 18:50:20 -07:00
Rebase against 28ec2795186c7db83637b3b17e4fa95095ebb77d.
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -1,70 +0,0 @@
|
||||
From b71e5960bb9cc8926ab03d7c2abf70ad976f9732 Mon Sep 17 00:00:00 2001
|
||||
From: Dmitry Timoshkov <dmitry@baikal.ru>
|
||||
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
|
||||
|
@@ -1,30 +0,0 @@
|
||||
From 82ead58d02badf4e84124277868942b089d9b7ba Mon Sep 17 00:00:00 2001
|
||||
From: Dmitry Timoshkov <dmitry@baikal.ru>
|
||||
Date: Thu, 27 Oct 2016 14:48:45 +0800
|
||||
Subject: windowscodecs: Add registration of the GIF encoder.
|
||||
|
||||
---
|
||||
dlls/windowscodecs/windowscodecs_wincodec.idl | 7 +++++++
|
||||
1 file changed, 7 insertions(+)
|
||||
|
||||
diff --git a/dlls/windowscodecs/windowscodecs_wincodec.idl b/dlls/windowscodecs/windowscodecs_wincodec.idl
|
||||
index fd7ff01..1681b1d 100644
|
||||
--- a/dlls/windowscodecs/windowscodecs_wincodec.idl
|
||||
+++ b/dlls/windowscodecs/windowscodecs_wincodec.idl
|
||||
@@ -70,6 +70,13 @@ coclass WICBmpEncoder { interface IWICBitmapEncoder; }
|
||||
coclass WICGifDecoder { interface IWICBitmapDecoder; }
|
||||
|
||||
[
|
||||
+ helpstring("WIC GIF Encoder"),
|
||||
+ threading(both),
|
||||
+ uuid(114f5598-0b22-40a0-86a1-c83ea495adbd)
|
||||
+]
|
||||
+coclass WICGifEncoder { interface IWICBitmapEncoder; }
|
||||
+
|
||||
+[
|
||||
helpstring("WIC ICO Decoder"),
|
||||
threading(both),
|
||||
uuid(c61bfcdf-2e0f-4aad-a8d7-e06bafebcdfe)
|
||||
--
|
||||
2.9.0
|
||||
|
@@ -1,27 +0,0 @@
|
||||
From fe01c9d286b55485fc241f42a617a3a75f2553c4 Mon Sep 17 00:00:00 2001
|
||||
From: Dmitry Timoshkov <dmitry@baikal.ru>
|
||||
Date: Thu, 27 Oct 2016 14:50:03 +0800
|
||||
Subject: windowscodecs: Fix IWICBitmapDecoder::CopyPalette for a not
|
||||
initialized case in the GIF decoder.
|
||||
|
||||
---
|
||||
dlls/windowscodecs/gifformat.c | 3 +++
|
||||
1 file changed, 3 insertions(+)
|
||||
|
||||
diff --git a/dlls/windowscodecs/gifformat.c b/dlls/windowscodecs/gifformat.c
|
||||
index 6052726..3dac59e 100644
|
||||
--- a/dlls/windowscodecs/gifformat.c
|
||||
+++ b/dlls/windowscodecs/gifformat.c
|
||||
@@ -1198,6 +1198,9 @@ static HRESULT WINAPI GifDecoder_CopyPalette(IWICBitmapDecoder *iface, IWICPalet
|
||||
|
||||
TRACE("(%p,%p)\n", iface, palette);
|
||||
|
||||
+ if (!This->gif)
|
||||
+ return WINCODEC_ERR_WRONGSTATE;
|
||||
+
|
||||
cm = This->gif->SColorMap;
|
||||
if (cm)
|
||||
{
|
||||
--
|
||||
2.9.0
|
||||
|
@@ -1,30 +0,0 @@
|
||||
From 855d2b2c5a978f441a2f2f1343fb53b03b3568c9 Mon Sep 17 00:00:00 2001
|
||||
From: Dmitry Timoshkov <dmitry@baikal.ru>
|
||||
Date: Thu, 27 Oct 2016 14:52:43 +0800
|
||||
Subject: windowscodecs: Better follow the GIF spec and don't specify the local
|
||||
color table size if there is no local palette.
|
||||
|
||||
---
|
||||
dlls/windowscodecs/gifformat.c | 4 +++-
|
||||
1 file changed, 3 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/dlls/windowscodecs/gifformat.c b/dlls/windowscodecs/gifformat.c
|
||||
index 3dac59e..9d0ae6b 100644
|
||||
--- a/dlls/windowscodecs/gifformat.c
|
||||
+++ b/dlls/windowscodecs/gifformat.c
|
||||
@@ -2070,9 +2070,11 @@ static HRESULT WINAPI GifFrameEncode_Commit(IWICBitmapFrameEncode *iface)
|
||||
imd.height = This->height;
|
||||
imd.packed = 0;
|
||||
if (This->colors)
|
||||
+ {
|
||||
imd.packed |= 0x80; /* local color table flag */
|
||||
+ imd.packed |= 0x07; /* local color table size */
|
||||
+ }
|
||||
/* FIXME: interlace flag */
|
||||
- imd.packed |= 0x07; /* local color table size */
|
||||
hr = IStream_Write(This->encoder->stream, &imd, sizeof(imd), NULL);
|
||||
if (hr == S_OK && This->colors)
|
||||
{
|
||||
--
|
||||
2.9.0
|
||||
|
@@ -1,130 +0,0 @@
|
||||
From 59176c773e3e710418c79641ca3c11d81ce98849 Mon Sep 17 00:00:00 2001
|
||||
From: Dmitry Timoshkov <dmitry@baikal.ru>
|
||||
Date: Thu, 27 Oct 2016 15:17:19 +0800
|
||||
Subject: [PATCH] windowscodecs/tests: Add the tests for GIF encoder and
|
||||
decoder.
|
||||
|
||||
---
|
||||
dlls/windowscodecs/tests/converter.c | 59 +++++++++++++++++++++++++---
|
||||
1 file changed, 54 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/dlls/windowscodecs/tests/converter.c b/dlls/windowscodecs/tests/converter.c
|
||||
index 7d956a69..09125603 100644
|
||||
--- a/dlls/windowscodecs/tests/converter.c
|
||||
+++ b/dlls/windowscodecs/tests/converter.c
|
||||
@@ -1071,6 +1071,40 @@ static void check_png_format(IStream *stream, const WICPixelFormatGUID *format)
|
||||
ok(0, "unknown PNG pixel format %s\n", wine_dbgstr_guid(format));
|
||||
}
|
||||
|
||||
+static void check_gif_format(IStream *stream, const WICPixelFormatGUID *format)
|
||||
+{
|
||||
+#include "pshpack1.h"
|
||||
+ struct logical_screen_descriptor
|
||||
+ {
|
||||
+ char signature[6];
|
||||
+ USHORT width;
|
||||
+ USHORT height;
|
||||
+ BYTE packed;
|
||||
+ /* global_color_table_flag : 1;
|
||||
+ * color_resolution : 3;
|
||||
+ * sort_flag : 1;
|
||||
+ * global_color_table_size : 3;
|
||||
+ */
|
||||
+ BYTE background_color_index;
|
||||
+ BYTE pixel_aspect_ratio;
|
||||
+ } lsd;
|
||||
+#include "poppack.h"
|
||||
+ UINT color_resolution;
|
||||
+ HRESULT hr;
|
||||
+
|
||||
+ memset(&lsd, 0, sizeof(lsd));
|
||||
+ hr = IStream_Read(stream, &lsd, sizeof(lsd), NULL);
|
||||
+ ok(hr == S_OK, "IStream_Read error %#x\n", hr);
|
||||
+
|
||||
+ ok(!memcmp(lsd.signature, "GIF89a", 6), "wrong GIF signature %.6s\n", lsd.signature);
|
||||
+
|
||||
+ ok(lsd.width == 32, "wrong width %u\n", lsd.width);
|
||||
+ ok(lsd.height == 2, "wrong height %u\n", lsd.height);
|
||||
+ color_resolution = 1 << (((lsd.packed >> 4) & 0x07) + 1);
|
||||
+ ok(color_resolution == 256, "wrong color resolution %u\n", color_resolution);
|
||||
+ ok(lsd.pixel_aspect_ratio == 0, "wrong pixel_aspect_ratio %u\n", lsd.pixel_aspect_ratio);
|
||||
+}
|
||||
+
|
||||
static void check_bitmap_format(IStream *stream, const CLSID *encoder, const WICPixelFormatGUID *format)
|
||||
{
|
||||
HRESULT hr;
|
||||
@@ -1086,6 +1120,8 @@ static void check_bitmap_format(IStream *stream, const CLSID *encoder, const WIC
|
||||
check_bmp_format(stream, format);
|
||||
else if (IsEqualGUID(encoder, &CLSID_WICTiffEncoder))
|
||||
check_tiff_format(stream, format);
|
||||
+ else if (IsEqualGUID(encoder, &CLSID_WICGifEncoder))
|
||||
+ check_gif_format(stream, format);
|
||||
else
|
||||
ok(0, "unknown encoder %s\n", wine_dbgstr_guid(encoder));
|
||||
|
||||
@@ -1204,7 +1240,7 @@ static void test_multi_encoder(const struct bitmap_data **srcs, const CLSID* cls
|
||||
|
||||
hr = CoCreateInstance(clsid_encoder, NULL, CLSCTX_INPROC_SERVER,
|
||||
&IID_IWICBitmapEncoder, (void**)&encoder);
|
||||
- ok(SUCCEEDED(hr), "CoCreateInstance failed, hr=%x\n", hr);
|
||||
+ ok(SUCCEEDED(hr), "CoCreateInstance(%s) failed, hr=%x\n", wine_dbgstr_guid(clsid_encoder), hr);
|
||||
if (SUCCEEDED(hr))
|
||||
{
|
||||
hglobal = GlobalAlloc(GMEM_MOVEABLE, 0);
|
||||
@@ -1231,7 +1267,10 @@ static void test_multi_encoder(const struct bitmap_data **srcs, const CLSID* cls
|
||||
if (palette)
|
||||
{
|
||||
hr = IWICBitmapEncoder_SetPalette(encoder, palette);
|
||||
- ok(hr == WINCODEC_ERR_UNSUPPORTEDOPERATION, "wrong error %#x\n", hr);
|
||||
+ if (IsEqualGUID(clsid_encoder, &CLSID_WICGifEncoder))
|
||||
+ ok(hr == S_OK, "SetPalette failed, hr=%#x\n", hr);
|
||||
+ else
|
||||
+ ok(hr == WINCODEC_ERR_UNSUPPORTEDOPERATION, "wrong error %#x\n", hr);
|
||||
hr = S_OK;
|
||||
}
|
||||
|
||||
@@ -1384,13 +1423,19 @@ static void test_multi_encoder(const struct bitmap_data **srcs, const CLSID* cls
|
||||
ok(hr == S_OK, "CreatePalette error %#x\n", hr);
|
||||
|
||||
hr = IWICBitmapDecoder_CopyPalette(decoder, frame_palette);
|
||||
- ok(hr == WINCODEC_ERR_PALETTEUNAVAILABLE, "wrong error %#x\n", hr);
|
||||
+ if (IsEqualGUID(clsid_decoder, &CLSID_WICGifDecoder))
|
||||
+ ok(hr == WINCODEC_ERR_WRONGSTATE, "wrong error %#x\n", hr);
|
||||
+ else
|
||||
+ ok(hr == WINCODEC_ERR_PALETTEUNAVAILABLE, "wrong error %#x\n", hr);
|
||||
|
||||
hr = IWICBitmapDecoder_Initialize(decoder, stream, WICDecodeMetadataCacheOnDemand);
|
||||
ok(SUCCEEDED(hr), "Initialize failed, hr=%x\n", hr);
|
||||
|
||||
hr = IWICBitmapDecoder_CopyPalette(decoder, frame_palette);
|
||||
- ok(hr == WINCODEC_ERR_PALETTEUNAVAILABLE, "wrong error %#x\n", hr);
|
||||
+ if (IsEqualGUID(clsid_decoder, &CLSID_WICGifDecoder))
|
||||
+ ok(hr == S_OK || broken(hr == WINCODEC_ERR_FRAMEMISSING) /* XP */, "CopyPalette failed, hr=%#x\n", hr);
|
||||
+ else
|
||||
+ ok(hr == WINCODEC_ERR_PALETTEUNAVAILABLE, "wrong error %#x\n", hr);
|
||||
|
||||
hr = S_OK;
|
||||
i=0;
|
||||
@@ -1449,7 +1494,8 @@ static void test_multi_encoder(const struct bitmap_data **srcs, const CLSID* cls
|
||||
}
|
||||
}
|
||||
else if (IsEqualGUID(clsid_decoder, &CLSID_WICBmpDecoder) ||
|
||||
- IsEqualGUID(clsid_decoder, &CLSID_WICTiffDecoder))
|
||||
+ IsEqualGUID(clsid_decoder, &CLSID_WICTiffDecoder) ||
|
||||
+ IsEqualGUID(clsid_decoder, &CLSID_WICGifDecoder))
|
||||
{
|
||||
if (IsEqualGUID(&pixelformat, &GUID_WICPixelFormatBlackWhite) ||
|
||||
IsEqualGUID(&pixelformat, &GUID_WICPixelFormat8bppIndexed))
|
||||
@@ -1789,6 +1835,9 @@ START_TEST(converter)
|
||||
test_default_converter();
|
||||
test_converter_8bppIndexed();
|
||||
|
||||
+ test_encoder(&testdata_8bppIndexed, &CLSID_WICGifEncoder,
|
||||
+ &testdata_8bppIndexed, &CLSID_WICGifDecoder, "GIF encoder 8bppIndexed");
|
||||
+
|
||||
test_encoder(&testdata_BlackWhite, &CLSID_WICPngEncoder,
|
||||
&testdata_BlackWhite, &CLSID_WICPngDecoder, "PNG encoder BlackWhite");
|
||||
test_encoder(&testdata_1bppIndexed, &CLSID_WICPngEncoder,
|
||||
--
|
||||
2.19.1
|
||||
|
@@ -1,32 +0,0 @@
|
||||
From ae0320150d2baec0415219ef3991431eb2ccc7af Mon Sep 17 00:00:00 2001
|
||||
From: Dmitry Timoshkov <dmitry@baikal.ru>
|
||||
Date: Sun, 6 Nov 2016 16:28:12 +0800
|
||||
Subject: [PATCH] windowscodecs: Correctly indicate that the global info
|
||||
was written even without the global palette.
|
||||
|
||||
---
|
||||
dlls/windowscodecs/gifformat.c | 5 +++--
|
||||
1 file changed, 3 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/dlls/windowscodecs/gifformat.c b/dlls/windowscodecs/gifformat.c
|
||||
index 58144ca..6851296 100644
|
||||
--- a/dlls/windowscodecs/gifformat.c
|
||||
+++ b/dlls/windowscodecs/gifformat.c
|
||||
@@ -2041,11 +2041,12 @@ static HRESULT WINAPI GifFrameEncode_Commit(IWICBitmapFrameEncode *iface)
|
||||
gif_palette[i][2] = This->encoder->palette[i] & 0xff;
|
||||
}
|
||||
hr = IStream_Write(This->encoder->stream, gif_palette, sizeof(gif_palette), NULL);
|
||||
- if (hr == S_OK)
|
||||
- This->encoder->info_written = TRUE;
|
||||
}
|
||||
|
||||
/* FIXME: write GCE, APE, etc. GIF extensions */
|
||||
+
|
||||
+ if (hr == S_OK)
|
||||
+ This->encoder->info_written = TRUE;
|
||||
}
|
||||
|
||||
if (hr == S_OK)
|
||||
--
|
||||
1.9.1
|
||||
|
Reference in New Issue
Block a user