From 343a81007b4c7f0556c9196fa9ff31ffba7b4be7 Mon Sep 17 00:00:00 2001 From: Zdenek Dohnal Date: Mon, 20 Feb 2023 18:48:27 +0100 Subject: [PATCH] Commit the patch --- ...moved-leftover-HAVE_LIBZ-conditional.patch | 61 +++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 0001-cfImageOpenFP-Removed-leftover-HAVE_LIBZ-conditional.patch diff --git a/0001-cfImageOpenFP-Removed-leftover-HAVE_LIBZ-conditional.patch b/0001-cfImageOpenFP-Removed-leftover-HAVE_LIBZ-conditional.patch new file mode 100644 index 0000000..f901917 --- /dev/null +++ b/0001-cfImageOpenFP-Removed-leftover-HAVE_LIBZ-conditional.patch @@ -0,0 +1,61 @@ +From 6b87c6e8f4c87652a73841fbc4259ff63c25b0f6 Mon Sep 17 00:00:00 2001 +From: Till Kamppeter +Date: Sun, 5 Feb 2023 13:59:14 +0100 +Subject: [PATCH] cfImageOpenFP(): Removed leftover HAVE_LIBZ conditionals + +In an earlier commit we have removed the dependency on libz from the +build system as there is no explicit dependency on it in +libcupsfilters. + +The conditionals for libpng availability (HAVE_LIBPNG) were combined +with HAVE_LIBZ, probably due to internal use of libz by libpng. This +is unnecessary and broke PNG image reading support since HAVE_LIBZ +does not get defined any more by the build system. + +So we have simply removed the HAVE_LIBZ conditionals now. +--- + cupsfilters/image-png.c | 4 ++-- + cupsfilters/image.c | 4 ++-- + 2 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/cupsfilters/image-png.c b/cupsfilters/image-png.c +index 60bd6a86..9690cdf5 100644 +--- a/cupsfilters/image-png.c ++++ b/cupsfilters/image-png.c +@@ -18,7 +18,7 @@ + + #include "image-private.h" + +-#if defined(HAVE_LIBPNG) && defined(HAVE_LIBZ) ++#ifdef HAVE_LIBPNG + # include // Portable Network Graphics (PNG) definitions + + +@@ -315,4 +315,4 @@ _cfImageReadPNG( + + return (0); + } +-#endif // HAVE_LIBPNG && HAVE_LIBZ ++#endif // HAVE_LIBPNG +diff --git a/cupsfilters/image.c b/cupsfilters/image.c +index 76d1d8ca..cfd2095f 100644 +--- a/cupsfilters/image.c ++++ b/cupsfilters/image.c +@@ -382,12 +382,12 @@ cfImageOpenFP( + img->xppi = 200; + img->yppi = 200; + +-#if defined(HAVE_LIBPNG) && defined(HAVE_LIBZ) ++#ifdef HAVE_LIBPNG + if (!memcmp(header, "\211PNG", 4)) + status = _cfImageReadPNG(img, fp, primary, secondary, saturation, hue, + lut); + else +-#endif // HAVE_LIBPNG && HAVE_LIBZ ++#endif // HAVE_LIBPNG + #ifdef HAVE_LIBJPEG + if (!memcmp(header, "\377\330\377", 3) && // Start-of-Image + header[3] >= 0xe0 && header[3] <= 0xef) // APPn +-- +2.39.1 +