[Buildroot] [git commit] package/imagemagick: add option to build host-imagemagick with XML support

Thomas Petazzoni thomas.petazzoni at bootlin.com
Sun Dec 24 18:38:25 UTC 2023


commit: https://git.buildroot.net/buildroot/commit/?id=df89e73e92abcddfdfa5d61cd00757a7c80a699d
branch: https://git.buildroot.net/buildroot/commit/?id=refs/heads/master

Since upstream commit
https://github.com/ImageMagick/ImageMagick/commit/25e3a4f3845f59536d19aba0ac0580aa6715147f
(which first appeared in version 7.1.1-19), ImageMagick does not trust
unvalidated XMP profiles in images anymore.

If such a XML profile is encountered inside e.g. a PNG image the
processing is aborted. Validating the XMP profile requires that
ImageMagick is compiled with XML support.
As host-imagemagick supports PNG file also activate XML support.

Signed-off-by: Christian Hitz <christian.hitz at bbv.ch>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni at bootlin.com>
---
 package/imagemagick/Config.in.host | 11 +++++++++++
 package/imagemagick/imagemagick.mk | 14 +++++++++-----
 2 files changed, 20 insertions(+), 5 deletions(-)

diff --git a/package/imagemagick/Config.in.host b/package/imagemagick/Config.in.host
index 5055101e23..26912e5f04 100644
--- a/package/imagemagick/Config.in.host
+++ b/package/imagemagick/Config.in.host
@@ -18,6 +18,7 @@ config BR2_PACKAGE_HOST_IMAGEMAGICK_SVG
 	bool "SVG support"
 	depends on BR2_PACKAGE_HOST_RUSTC_ARCH_SUPPORTS # host-librsvg
 	depends on BR2_HOST_GCC_AT_LEAST_4_9 # host-pango -> host-harfbuzz
+	select BR2_PACKAGE_HOST_IMAGEMAGICK_XML
 	help
 	  Say 'y' here is you need ImageMagick tools (like convert)
 	  to support SVG.
@@ -29,4 +30,14 @@ comment "SVG support needs host gcc >= 4.9"
 	depends on BR2_PACKAGE_HOST_RUSTC_ARCH_SUPPORTS
 	depends on !BR2_HOST_GCC_AT_LEAST_4_9
 
+config BR2_PACKAGE_HOST_IMAGEMAGICK_XML
+	bool "XML support"
+	help
+	  Say 'y' here if you need ImageMagick to support XML. Indeed,
+	  ImageMagick does not trust unvalidated XMP profiles in
+	  images. If such a XML profile is encountered inside e.g. a
+	  PNG image the processing is aborted. Validating the XMP
+	  profile requires that ImageMagick is compiled with XML
+	  support.
+
 endif
diff --git a/package/imagemagick/imagemagick.mk b/package/imagemagick/imagemagick.mk
index 719c6768af..53cf02abf4 100644
--- a/package/imagemagick/imagemagick.mk
+++ b/package/imagemagick/imagemagick.mk
@@ -238,22 +238,26 @@ HOST_IMAGEMAGICK_DEPENDENCIES += \
 	host-fontconfig \
 	host-freetype \
 	host-librsvg \
-	host-libxml2 \
 	host-pango
 HOST_IMAGEMAGICK_CONF_ENV += ac_cv_path_xml2_config=$(HOST_DIR)/bin/xml2-config
 HOST_IMAGEMAGICK_CONF_OPTS += \
 	--with-fontconfig \
 	--with-freetype \
 	--with-pango \
-	--with-rsvg \
-	--with-xml
+	--with-rsvg
 else
 HOST_IMAGEMAGICK_CONF_OPTS += \
 	--without-fontconfig \
 	--without-freetype \
 	--without-pango \
-	--without-rsvg \
-	--without-xml
+	--without-rsvg
+endif
+
+ifeq ($(BR2_PACKAGE_HOST_IMAGEMAGICK_XML),y)
+HOST_IMAGEMAGICK_CONF_OPTS += --with-xml
+HOST_IMAGEMAGICK_DEPENDENCIES += host-libxml2
+else
+HOST_IMAGEMAGICK_CONF_OPTS += --without-xml
 endif
 
 $(eval $(autotools-package))



More information about the buildroot mailing list