Skip to content
This repository has been archived by the owner on Oct 1, 2020. It is now read-only.

Commit

Permalink
windowscodecs-Palette_Images: Update patches and add missing registra…
Browse files Browse the repository at this point in the history
…tion of new pixel formats.
  • Loading branch information
slackner committed Oct 15, 2016
1 parent f8de4c4 commit f176092
Show file tree
Hide file tree
Showing 4 changed files with 70 additions and 12 deletions.
4 changes: 2 additions & 2 deletions patches/patchinstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7220,8 +7220,8 @@ fi
# |
# | Modified files:
# | * dlls/windowscodecs/bmpdecode.c, dlls/windowscodecs/bmpencode.c, dlls/windowscodecs/imgfactory.c,
# | dlls/windowscodecs/main.c, dlls/windowscodecs/pngformat.c, dlls/windowscodecs/tests/converter.c,
# | dlls/windowscodecs/tests/pngformat.c, dlls/windowscodecs/tiffformat.c
# | dlls/windowscodecs/main.c, dlls/windowscodecs/pngformat.c, dlls/windowscodecs/regsvr.c,
# | dlls/windowscodecs/tests/converter.c, dlls/windowscodecs/tests/pngformat.c, dlls/windowscodecs/tiffformat.c
# |
if test "$enable_windowscodecs_Palette_Images" -eq 1; then
patch_apply windowscodecs-Palette_Images/0001-windowscodecs-Implement-IWICBitmapDecoder-CopyPalett.patch
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
From 9fb318f61a9b336397e74cab3e602cba54cab2a5 Mon Sep 17 00:00:00 2001
From 22e7223f23016a0c1cffeb58158c59ec82273e51 Mon Sep 17 00:00:00 2001
From: Dmitry Timoshkov <dmitry@baikal.ru>
Date: Tue, 20 Sep 2016 14:28:49 +0800
Subject: windowscodecs: Add support for palette image formats to PNG encoder.

---
dlls/windowscodecs/pngformat.c | 45 ++++++++++++++++++++++++++++++++++++++++++
1 file changed, 45 insertions(+)
dlls/windowscodecs/regsvr.c | 4 ++++
2 files changed, 49 insertions(+)

diff --git a/dlls/windowscodecs/pngformat.c b/dlls/windowscodecs/pngformat.c
index 4473b98..d8b4e2f 100644
Expand Down Expand Up @@ -94,6 +95,21 @@ index 4473b98..d8b4e2f 100644
ppng_write_info(This->png_ptr, This->info_ptr);

if (This->format->remove_filler)
diff --git a/dlls/windowscodecs/regsvr.c b/dlls/windowscodecs/regsvr.c
index 10a6c03..b011d71 100644
--- a/dlls/windowscodecs/regsvr.c
+++ b/dlls/windowscodecs/regsvr.c
@@ -1359,6 +1359,10 @@ static GUID const * const png_encode_formats[] = {
&GUID_WICPixelFormat32bppBGRA,
&GUID_WICPixelFormat48bppRGB,
&GUID_WICPixelFormat64bppRGBA,
+ &GUID_WICPixelFormat1bppIndexed,
+ &GUID_WICPixelFormat2bppIndexed,
+ &GUID_WICPixelFormat4bppIndexed,
+ &GUID_WICPixelFormat8bppIndexed,
NULL
};

--
2.9.0

Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
From d68de6ad4c3d41a3b6b879ee24e1775e67763310 Mon Sep 17 00:00:00 2001
From 30634fd0942862f1ac76fe43bb64246232c9cf4b Mon Sep 17 00:00:00 2001
From: Dmitry Timoshkov <dmitry@baikal.ru>
Date: Fri, 23 Sep 2016 16:36:50 +0800
Subject: windowscodecs: Add support for palette image formats to TIFF encoder.

---
dlls/windowscodecs/main.c | 4 ++--
dlls/windowscodecs/regsvr.c | 6 ++++++
dlls/windowscodecs/tests/converter.c | 25 ++++++++++++++++---------
dlls/windowscodecs/tiffformat.c | 26 ++++++++++++++++++++++++++
3 files changed, 44 insertions(+), 11 deletions(-)
4 files changed, 50 insertions(+), 11 deletions(-)

diff --git a/dlls/windowscodecs/main.c b/dlls/windowscodecs/main.c
index 442976f..fdd26dd 100644
Expand All @@ -24,8 +25,32 @@ index 442976f..fdd26dd 100644
}

if (xres == 0.0 || yres == 0.0)
diff --git a/dlls/windowscodecs/regsvr.c b/dlls/windowscodecs/regsvr.c
index b011d71..b32b294 100644
--- a/dlls/windowscodecs/regsvr.c
+++ b/dlls/windowscodecs/regsvr.c
@@ -1211,6 +1211,8 @@ static GUID const * const tiff_decode_formats[] = {
&GUID_WICPixelFormatBlackWhite,
&GUID_WICPixelFormat4bppGray,
&GUID_WICPixelFormat8bppGray,
+ &GUID_WICPixelFormat1bppIndexed,
+ &GUID_WICPixelFormat2bppIndexed,
&GUID_WICPixelFormat4bppIndexed,
&GUID_WICPixelFormat8bppIndexed,
&GUID_WICPixelFormat24bppBGR,
@@ -1370,6 +1372,10 @@ static GUID const * const tiff_encode_formats[] = {
&GUID_WICPixelFormatBlackWhite,
&GUID_WICPixelFormat4bppGray,
&GUID_WICPixelFormat8bppGray,
+ &GUID_WICPixelFormat1bppIndexed,
+ &GUID_WICPixelFormat2bppIndexed,
+ &GUID_WICPixelFormat4bppIndexed,
+ &GUID_WICPixelFormat8bppIndexed,
&GUID_WICPixelFormat24bppBGR,
&GUID_WICPixelFormat32bppBGRA,
&GUID_WICPixelFormat32bppPBGRA,
diff --git a/dlls/windowscodecs/tests/converter.c b/dlls/windowscodecs/tests/converter.c
index 78bc8f5..e7b9ba9 100644
index 13a8884..ca74e35 100644
--- a/dlls/windowscodecs/tests/converter.c
+++ b/dlls/windowscodecs/tests/converter.c
@@ -706,13 +706,13 @@ static void check_tiff_format(IStream *stream, const WICPixelFormatGUID *format)
Expand Down Expand Up @@ -73,7 +98,7 @@ index 78bc8f5..e7b9ba9 100644
else if (IsEqualGUID(dsts[i]->format, &GUID_WICPixelFormat4bppIndexed))
{
ok(count == 16, "expected 16, got %u (%s)\n", count, name);
@@ -1385,17 +1395,14 @@ if (!strcmp(winetest_platform, "windows")) /* FIXME: enable once implemented in
@@ -1386,17 +1396,14 @@ if (!strcmp(winetest_platform, "windows")) /* FIXME: enable once implemented in

test_encoder(&testdata_BlackWhite, &CLSID_WICTiffEncoder,
&testdata_BlackWhite, &CLSID_WICTiffDecoder, "TIFF encoder BlackWhite");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
From 3f53a82d7bb5e2cd8ea740094675a009df702fbb Mon Sep 17 00:00:00 2001
From b57a1d4183ec5241664c63fb3855d8863c8d9a98 Mon Sep 17 00:00:00 2001
From: Dmitry Timoshkov <dmitry@baikal.ru>
Date: Fri, 23 Sep 2016 20:17:47 +0800
Subject: windowscodecs: Add support for palette image formats to BMP encoder.

---
dlls/windowscodecs/bmpencode.c | 44 ++++++++++++++++++++++++++++--------
dlls/windowscodecs/main.c | 8 ++++++-
dlls/windowscodecs/regsvr.c | 5 ++++
dlls/windowscodecs/tests/converter.c | 18 +++++++++++----
3 files changed, 55 insertions(+), 15 deletions(-)
4 files changed, 60 insertions(+), 15 deletions(-)

diff --git a/dlls/windowscodecs/bmpencode.c b/dlls/windowscodecs/bmpencode.c
index af082ae..d4ec651 100644
Expand Down Expand Up @@ -151,8 +152,24 @@ index fdd26dd..7931b3d 100644
{
/* FIXME: should use WICConvertBitmapSource to convert */
FIXME("format %s unsupported\n", debugstr_guid(&src_format));
diff --git a/dlls/windowscodecs/regsvr.c b/dlls/windowscodecs/regsvr.c
index b32b294..c72fbf1 100644
--- a/dlls/windowscodecs/regsvr.c
+++ b/dlls/windowscodecs/regsvr.c
@@ -1347,6 +1347,11 @@ static GUID const * const bmp_encode_formats[] = {
&GUID_WICPixelFormat16bppBGR565,
&GUID_WICPixelFormat24bppBGR,
&GUID_WICPixelFormat32bppBGR,
+ &GUID_WICPixelFormatBlackWhite,
+ &GUID_WICPixelFormat1bppIndexed,
+ &GUID_WICPixelFormat2bppIndexed,
+ &GUID_WICPixelFormat4bppIndexed,
+ &GUID_WICPixelFormat8bppIndexed,
NULL
};

diff --git a/dlls/windowscodecs/tests/converter.c b/dlls/windowscodecs/tests/converter.c
index 865029f..901fbd8 100644
index fa0a8f4..feeca5b 100644
--- a/dlls/windowscodecs/tests/converter.c
+++ b/dlls/windowscodecs/tests/converter.c
@@ -768,6 +768,8 @@ static void check_bmp_format(IStream *stream, const WICPixelFormatGUID *format)
Expand Down Expand Up @@ -210,7 +227,7 @@ index 865029f..901fbd8 100644
"SetPixelFormat changed the format to %s (%s)\n", wine_dbgstr_guid(&pixelformat), name);

hr = IWICBitmapFrameEncode_SetSize(frameencode, srcs[i]->width, srcs[i]->height);
@@ -1377,19 +1388,16 @@ START_TEST(converter)
@@ -1378,19 +1389,16 @@ START_TEST(converter)
test_encoder(&testdata_24bppBGR, &CLSID_WICPngEncoder,
&testdata_24bppBGR, &CLSID_WICPngDecoder, "PNG encoder 24bppBGR");

Expand Down

0 comments on commit f176092

Please sign in to comment.