From 38aa047cad59db7854662d85f6e93e5c1eec3e78 Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Fri, 22 Feb 2019 08:51:56 +1100 Subject: [PATCH] Rebase against 812d03129dea53337367789bac8ab523b9fce21d --- patches/patchinstall.sh | 4 +- ...ve-JPEG-frame-image-data-initializat.patch | 27 ++------ ...d-support-for-CMYK-to-BGR-conversion.patch | 66 ------------------- 3 files changed, 8 insertions(+), 89 deletions(-) delete mode 100644 patches/windowscodecs-JPEG_Decoder/0005-windowscodecs-Add-support-for-CMYK-to-BGR-conversion.patch diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index c6eef932..b57dfe44 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -52,7 +52,7 @@ usage() # Get the upstream commit sha upstream_commit() { - echo "c0cc126d579e078f2804112c14f0c18b38f68937" + echo "812d03129dea53337367789bac8ab523b9fce21d" } # Show version information @@ -6546,10 +6546,8 @@ fi # | if test "$enable_windowscodecs_JPEG_Decoder" -eq 1; then patch_apply windowscodecs-JPEG_Decoder/0004-windowscodecs-Move-JPEG-frame-image-data-initializat.patch - patch_apply windowscodecs-JPEG_Decoder/0005-windowscodecs-Add-support-for-CMYK-to-BGR-conversion.patch ( printf '%s\n' '+ { "Dmitry Timoshkov", "windowscodecs: Move JPEG frame image data initialization from Frame::CopyPixels to Decoder::Initialize.", 2 },'; - printf '%s\n' '+ { "Dmitry Timoshkov", "windowscodecs: Add support for CMYK to BGR conversion.", 1 },'; ) >> "$patchlist" fi diff --git a/patches/windowscodecs-JPEG_Decoder/0004-windowscodecs-Move-JPEG-frame-image-data-initializat.patch b/patches/windowscodecs-JPEG_Decoder/0004-windowscodecs-Move-JPEG-frame-image-data-initializat.patch index ee5fb498..f2c91598 100644 --- a/patches/windowscodecs-JPEG_Decoder/0004-windowscodecs-Move-JPEG-frame-image-data-initializat.patch +++ b/patches/windowscodecs-JPEG_Decoder/0004-windowscodecs-Move-JPEG-frame-image-data-initializat.patch @@ -1,30 +1,17 @@ -From 11fa0f222539e2dedaed99783ad6af4577eae250 Mon Sep 17 00:00:00 2001 +From bbfed73428278d26bd202fb559a14c11ec923c63 Mon Sep 17 00:00:00 2001 From: Dmitry Timoshkov Date: Fri, 18 Aug 2017 12:17:52 +0800 -Subject: [PATCH 714/851] windowscodecs: Move JPEG frame image data - initialization from Frame::CopyPixels to Decoder::Initialize. (v2) +Subject: [PATCH] windowscodecs: Move JPEG frame image data initialization from + Frame::CopyPixels to Decoder::Initialize. (v2) This is how PNG decoder does things, and it avoids image data corruption in some cases (presumably when libjpeg reuses existing scanline data). --- - dlls/windowscodecs/converter.c | 1 + - dlls/windowscodecs/jpegformat.c | 152 ++++++++++++-------------------- - 2 files changed, 57 insertions(+), 96 deletions(-) + dlls/windowscodecs/jpegformat.c | 152 +++++++++++++++------------------------- + 1 file changed, 56 insertions(+), 96 deletions(-) -diff --git a/dlls/windowscodecs/converter.c b/dlls/windowscodecs/converter.c -index d23c26250c..39c926c5ca 100644 ---- a/dlls/windowscodecs/converter.c -+++ b/dlls/windowscodecs/converter.c -@@ -30,6 +30,7 @@ - - #include "wincodecs_private.h" - -+#include "wine/heap.h" - #include "wine/debug.h" - - WINE_DEFAULT_DEBUG_CHANNEL(wincodecs); diff --git a/dlls/windowscodecs/jpegformat.c b/dlls/windowscodecs/jpegformat.c -index c846e6191c..3fb52661a8 100644 +index 54f77a7..1df898f 100644 --- a/dlls/windowscodecs/jpegformat.c +++ b/dlls/windowscodecs/jpegformat.c @@ -50,6 +50,7 @@ @@ -217,5 +204,5 @@ index c846e6191c..3fb52661a8 100644 } -- -2.19.1 +1.9.1 diff --git a/patches/windowscodecs-JPEG_Decoder/0005-windowscodecs-Add-support-for-CMYK-to-BGR-conversion.patch b/patches/windowscodecs-JPEG_Decoder/0005-windowscodecs-Add-support-for-CMYK-to-BGR-conversion.patch deleted file mode 100644 index d0705524..00000000 --- a/patches/windowscodecs-JPEG_Decoder/0005-windowscodecs-Add-support-for-CMYK-to-BGR-conversion.patch +++ /dev/null @@ -1,66 +0,0 @@ -From 042ed16cde1e29daecdeead7bbfbe876a2b5a067 Mon Sep 17 00:00:00 2001 -From: Dmitry Timoshkov -Date: Thu, 17 Aug 2017 14:57:18 +0800 -Subject: [PATCH] windowscodecs: Add support for CMYK to BGR conversion. -Content-Type: text/plain; charset=UTF-8 - ---- - dlls/windowscodecs/converter.c | 42 ++++++++++++++++++++++++++++++++++++++++++ - 1 file changed, 42 insertions(+) - -diff --git a/dlls/windowscodecs/converter.c b/dlls/windowscodecs/converter.c -index 5dccb70b1f..525e1838b8 100644 ---- a/dlls/windowscodecs/converter.c -+++ b/dlls/windowscodecs/converter.c -@@ -1085,6 +1085,48 @@ static HRESULT copypixels_to_24bppBGR(struct FormatConverter *This, const WICRec - } - return S_OK; - -+ case format_32bppCMYK: -+ if (prc) -+ { -+ BYTE *srcdata; -+ UINT srcstride, srcdatasize; -+ -+ srcstride = 4 * prc->Width; -+ srcdatasize = srcstride * prc->Height; -+ -+ srcdata = heap_alloc(srcdatasize); -+ if (!srcdata) return E_OUTOFMEMORY; -+ -+ hr = IWICBitmapSource_CopyPixels(This->source, prc, srcstride, srcdatasize, srcdata); -+ if (SUCCEEDED(hr)) -+ { -+ INT x, y; -+ BYTE *src = srcdata, *dst = pbBuffer; -+ -+ for (y = 0; y < prc->Height; y++) -+ { -+ BYTE *cmyk = src; -+ BYTE *bgr = dst; -+ -+ for (x = 0; x < prc->Width; x++) -+ { -+ BYTE c = cmyk[0], m = cmyk[1], y = cmyk[2], k = cmyk[3]; -+ bgr[0] = (255 - y) * (255 - k) / 255; /* B */ -+ bgr[1] = (255 - m) * (255 - k) / 255; /* G */ -+ bgr[2] = (255 - c) * (255 - k) / 255; /* R */ -+ cmyk += 4; -+ bgr += 3; -+ } -+ src += srcstride; -+ dst += cbStride; -+ } -+ } -+ -+ heap_free(srcdata); -+ return hr; -+ } -+ return S_OK; -+ - default: - FIXME("Unimplemented conversion path!\n"); - return WINCODEC_ERR_UNSUPPORTEDOPERATION; --- -2.16.2 -