summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2026-07-06 07:34:45 +0200
committerRemi Collet <remi@php.net>2026-07-06 07:34:45 +0200
commitdd37212aff85adac293c729b52fa8766ff9efe7c (patch)
tree3a73f8173548415e47e77c4995a81e81417d640e
parentf65b1ee4b76dd43290c20a6c1bd9146cdcdc627d (diff)
patch from PRHEADmaster
-rw-r--r--0001-re-add-support-for-libheif-1.7.0.patch85
-rw-r--r--ImageMagick7.spec10
-rw-r--r--heif.patch117
3 files changed, 89 insertions, 123 deletions
diff --git a/0001-re-add-support-for-libheif-1.7.0.patch b/0001-re-add-support-for-libheif-1.7.0.patch
new file mode 100644
index 0000000..554daeb
--- /dev/null
+++ b/0001-re-add-support-for-libheif-1.7.0.patch
@@ -0,0 +1,85 @@
+diff --git a/coders/heic.c b/coders/heic.c
+index d7cae5b29..788dd3ed6 100644
+--- a/coders/heic.c
++++ b/coders/heic.c
+@@ -1035,8 +1035,10 @@ static Image *ReadHEICImage(const ImageInfo *image_info,ExceptionInfo *exception
+ #endif
+ ThrowReaderException(CoderError,"ImageTypeNotSupported");
+ (void) CloseBlob(image);
++#if LIBHEIF_NUMERIC_VERSION >= HEIC_COMPUTE_NUMERIC_VERSION(1,11,0)
+ if (heif_has_compatible_brand(magic,sizeof(magic), "avif") == 1)
+ (void) CopyMagickString(image->magick,"AVIF",MagickPathExtent);
++#endif
+ /*
+ Decode HEIF image.
+ */
+diff --git a/configure b/configure
+index 41de9c8f7..d0cb6bfc3 100755
+--- a/configure
++++ b/configure
+@@ -33816,19 +33816,19 @@ if test "x$with_heic" = "xyes"; then
+ printf "%s\n" "-------------------------------------------------------------" >&6; }
+
+ pkg_failed=no
+-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libheif >= 1.11.0" >&5
+-printf %s "checking for libheif >= 1.11.0... " >&6; }
++{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libheif >= 1.7.0" >&5
++printf %s "checking for libheif >= 1.7.0... " >&6; }
+
+ if test -n "$HEIF_CFLAGS"; then
+ pkg_cv_HEIF_CFLAGS="$HEIF_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+- { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libheif >= 1.11.0\""; } >&5
+- ($PKG_CONFIG --exists --print-errors "libheif >= 1.11.0") 2>&5
++ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libheif >= 1.7.0\""; } >&5
++ ($PKG_CONFIG --exists --print-errors "libheif >= 1.7.0") 2>&5
+ ac_status=$?
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+- pkg_cv_HEIF_CFLAGS=`$PKG_CONFIG --cflags "libheif >= 1.11.0" 2>/dev/null`
++ pkg_cv_HEIF_CFLAGS=`$PKG_CONFIG --cflags "libheif >= 1.7.0" 2>/dev/null`
+ test "x$?" != "x0" && pkg_failed=yes
+ else
+ pkg_failed=yes
+@@ -33840,12 +33840,12 @@ if test -n "$HEIF_LIBS"; then
+ pkg_cv_HEIF_LIBS="$HEIF_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+- { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libheif >= 1.11.0\""; } >&5
+- ($PKG_CONFIG --exists --print-errors "libheif >= 1.11.0") 2>&5
++ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libheif >= 1.7.0\""; } >&5
++ ($PKG_CONFIG --exists --print-errors "libheif >= 1.7.0") 2>&5
+ ac_status=$?
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+- pkg_cv_HEIF_LIBS=`$PKG_CONFIG --libs "libheif >= 1.11.0" 2>/dev/null`
++ pkg_cv_HEIF_LIBS=`$PKG_CONFIG --libs "libheif >= 1.7.0" 2>/dev/null`
+ test "x$?" != "x0" && pkg_failed=yes
+ else
+ pkg_failed=yes
+@@ -33866,9 +33866,9 @@ else
+ _pkg_short_errors_supported=no
+ fi
+ if test $_pkg_short_errors_supported = yes; then
+- HEIF_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libheif >= 1.11.0" 2>&1`
++ HEIF_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libheif >= 1.7.0" 2>&1`
+ else
+- HEIF_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libheif >= 1.11.0" 2>&1`
++ HEIF_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libheif >= 1.7.0" 2>&1`
+ fi
+ # Put the nasty error message in config.log where it belongs
+ echo "$HEIF_PKG_ERRORS" >&5
+diff --git a/configure.ac b/configure.ac
+index 3776989ef..7a7e605c9 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -2386,7 +2386,7 @@ HEIF_LIBS=""
+ HEIF_PKG=""
+ if test "x$with_heic" = "xyes"; then
+ AC_MSG_RESULT([-------------------------------------------------------------])
+- PKG_CHECK_MODULES([HEIF],[libheif >= 1.11.0],[have_heic=yes],[have_heic=no])
++ PKG_CHECK_MODULES([HEIF],[libheif >= 1.7.0],[have_heic=yes],[have_heic=no])
+ AC_MSG_RESULT([])
+ fi
+
diff --git a/ImageMagick7.spec b/ImageMagick7.spec
index ee3cc1d..d6867d0 100644
--- a/ImageMagick7.spec
+++ b/ImageMagick7.spec
@@ -76,8 +76,7 @@ Url: https://imagemagick.org/
%forgemeta
Source0: %{forgesource}
-# revert changes requiring libheif 1.11.0 for EL-8
-Patch0: heif.patch
+Patch0: 0001-re-add-support-for-libheif-1.7.0.patch
BuildRequires: gnupg2
BuildRequires: autoconf automake make
@@ -373,10 +372,7 @@ however.
# %{?gpgverify: %{gpgverify} --keyring=%{SOURCE2} --signature=%{SOURCE1} --data=%{SOURCE0}}
%forgesetup
-%if 0%{?rhel} == 8
-%patch -P0 -p1 -R
-sed -e 's/1.11.0/1.4.0/' -i configure
-%endif
+%patch -P0 -p1
# for %%doc
mkdir Magick++/examples
@@ -637,6 +633,8 @@ fi
* Mon Jul 6 2026 Remi Collet <remi@remirepo.net> - 7.1.2-27-1
- update to version 7.1.2 patch level 27
- drop patch merged upstream
+- fix build with libheic 1.7.0 using patch from
+ https://github.com/ImageMagick/ImageMagick/pull/8841
* Wed Jun 24 2026 Remi Collet <remi@remirepo.net> - 7.1.2-26-1
- update to version 7.1.2 patch level 26
diff --git a/heif.patch b/heif.patch
deleted file mode 100644
index 0812295..0000000
--- a/heif.patch
+++ /dev/null
@@ -1,117 +0,0 @@
-From c893eb2386365afce7b43179c622b62fe88302d4 Mon Sep 17 00:00:00 2001
-From: Dirk Lemstra <dirk@lemstra.org>
-Date: Sat, 4 Jul 2026 10:06:57 +0200
-Subject: [PATCH] Require at least version 1.11.0 of the libheif library.
-
----
- coders/heic.c | 17 ++---------------
- configure.ac | 2 +-
- 2 files changed, 3 insertions(+), 16 deletions(-)
-
-diff --git a/coders/heic.c b/coders/heic.c
-index 449f0e1ff5d..d7cae5b29fc 100644
---- a/coders/heic.c
-+++ b/coders/heic.c
-@@ -87,7 +87,8 @@
- #include <libheif/heif_sequences.h>
- #endif
- #endif
--
-+
-+
- #if defined(MAGICKCORE_HEIC_DELEGATE)
- /*
- Forward declarations.
-@@ -1034,10 +1035,8 @@ static Image *ReadHEICImage(const ImageInfo *image_info,ExceptionInfo *exception
- #endif
- ThrowReaderException(CoderError,"ImageTypeNotSupported");
- (void) CloseBlob(image);
--#if LIBHEIF_NUMERIC_VERSION >= HEIC_COMPUTE_NUMERIC_VERSION(1,11,0)
- if (heif_has_compatible_brand(magic,sizeof(magic), "avif") == 1)
- (void) CopyMagickString(image->magick,"AVIF",MagickPathExtent);
--#endif
- /*
- Decode HEIF image.
- */
-@@ -1250,7 +1249,6 @@ ModuleExport size_t RegisterHEICImage(void)
- entry->flags|=CoderDecoderSeekableStreamFlag;
- entry->flags^=CoderBlobSupportFlag;
- (void) RegisterMagickInfo(entry);
--#if LIBHEIF_NUMERIC_VERSION >= HEIC_COMPUTE_NUMERIC_VERSION(1,7,0)
- entry=AcquireMagickInfo("HEIC","AVCI","AVC Image File Format");
- #if defined(MAGICKCORE_HEIC_DELEGATE)
- if (heif_have_decoder_for_format(heif_compression_AVC))
-@@ -1266,8 +1264,6 @@ ModuleExport size_t RegisterHEICImage(void)
- entry->flags|=CoderDecoderSeekableStreamFlag;
- entry->flags^=CoderBlobSupportFlag;
- (void) RegisterMagickInfo(entry);
--#endif
--#if LIBHEIF_NUMERIC_VERSION >= HEIC_COMPUTE_NUMERIC_VERSION(1,7,0)
- entry=AcquireMagickInfo("HEIC","AVIF","AV1 Image File Format");
- #if defined(MAGICKCORE_HEIC_DELEGATE)
- if (heif_have_decoder_for_format(heif_compression_AV1))
-@@ -1283,7 +1279,6 @@ ModuleExport size_t RegisterHEICImage(void)
- entry->flags|=CoderDecoderSeekableStreamFlag;
- entry->flags^=CoderBlobSupportFlag;
- (void) RegisterMagickInfo(entry);
--#endif
- return(MagickImageCoderSignature);
- }
-
-@@ -1308,9 +1303,7 @@ ModuleExport size_t RegisterHEICImage(void)
- */
- ModuleExport void UnregisterHEICImage(void)
- {
--#if LIBHEIF_NUMERIC_VERSION >= HEIC_COMPUTE_NUMERIC_VERSION(1,7,0)
- (void) UnregisterMagickInfo("AVIF");
--#endif
- (void) UnregisterMagickInfo("HEIC");
- (void) UnregisterMagickInfo("HEIF");
- #if defined(MAGICKCORE_HEIC_DELEGATE)
-@@ -2357,9 +2350,7 @@ static MagickBooleanType WriteHEICImage(const ImageInfo *image_info,
- Image *image,ExceptionInfo *exception)
- {
- MagickBooleanType
--#if LIBHEIF_NUMERIC_VERSION >= HEIC_COMPUTE_NUMERIC_VERSION(1,7,0)
- encode_avif,
--#endif
- status;
-
- MagickOffsetType
-@@ -2391,10 +2382,8 @@ static MagickBooleanType WriteHEICImage(const ImageInfo *image_info,
- return(status);
- scene=0;
- heif_context=heif_context_alloc();
--#if LIBHEIF_NUMERIC_VERSION >= HEIC_COMPUTE_NUMERIC_VERSION(1,7,0)
- encode_avif=(LocaleCompare(image_info->magick,"AVIF") == 0) ? MagickTrue :
- MagickFalse;
--#endif
- #if LIBHEIF_NUMERIC_VERSION >= HEIC_COMPUTE_NUMERIC_VERSION(1,20,0)
- if ((encode_avif != MagickFalse) && (image_info->adjoin != MagickFalse) &&
- (GetNextImageInList(image) != (Image *) NULL))
-@@ -2457,12 +2446,10 @@ static MagickBooleanType WriteHEICImage(const ImageInfo *image_info,
- /*
- Get encoder for the specified format.
- */
--#if LIBHEIF_NUMERIC_VERSION >= HEIC_COMPUTE_NUMERIC_VERSION(1,7,0)
- if (encode_avif != MagickFalse)
- error=heif_context_get_encoder_for_format(heif_context,
- heif_compression_AV1,&heif_encoder);
- else
--#endif
- error=heif_context_get_encoder_for_format(heif_context,
- heif_compression_HEVC,&heif_encoder);
- if (IsHEIFSuccess(image,&error,exception) == MagickFalse)
-diff --git a/configure.ac b/configure.ac
-index 548268ea02e..3776989ef04 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -2386,7 +2386,7 @@ HEIF_LIBS=""
- HEIF_PKG=""
- if test "x$with_heic" = "xyes"; then
- AC_MSG_RESULT([-------------------------------------------------------------])
-- PKG_CHECK_MODULES([HEIF],[libheif >= 1.4.0],[have_heic=yes],[have_heic=no])
-+ PKG_CHECK_MODULES([HEIF],[libheif >= 1.11.0],[have_heic=yes],[have_heic=no])
- AC_MSG_RESULT([])
- fi
-