From 407bd1391ddb616c1d67e68a8009c08b6b676ec8 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Tue, 16 Nov 2021 10:51:19 +0100 Subject: [PATCH] allow libjxl 0.5 (#2539) --- configure.ac | 17 +++++++++++++++-- libvips/foreign/jxlsave.c | 2 ++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index d8632b7f..da566aa5 100644 --- a/configure.ac +++ b/configure.ac @@ -837,9 +837,9 @@ AS_IF([test x"$with_libjxl" = x"module"], [with_libjxl_module=no]) if test x"$with_libjxl" != x"no"; then - PKG_CHECK_MODULES(LIBJXL, libjxl_threads >= 0.6 libjxl >= 0.6, + PKG_CHECK_MODULES(LIBJXL, libjxl_threads >= 0.5 libjxl >= 0.5, [AC_DEFINE(HAVE_LIBJXL,1, - [define if you have libjxl >= 0.6 installed.]) + [define if you have libjxl >= 0.5 installed.]) with_libjxl=yes AS_IF([test x"$with_libjxl_module" = x"no"], [PACKAGES_USED="$PACKAGES_USED libjxl"]) @@ -851,6 +851,19 @@ if test x"$with_libjxl" != x"no"; then ) fi +if test x"$with_libjxl" = x"yes"; then + save_LIBS="$LIBS" + LIBS="$LIBS $LIBJXL_LIBS" + # Introduced in 0.6 + AC_CHECK_FUNCS(JxlEncoderInitBasicInfo,[ + AC_DEFINE(HAVE_LIBJXL_JXLENCODERINITBASICINFO,1, + [define if you have heif_image_handle_get_raw_color_profile.]) + ],[] + ) + LIBS="$save_LIBS" +fi + + AS_IF([test x"$with_libjxl_module" = x"yes"], [AC_DEFINE([LIBJXL_MODULE], [1], [define to build libjxl as a dynamically loadable module.])], [VIPS_CFLAGS="$VIPS_CFLAGS $LIBJXL_CFLAGS" diff --git a/libvips/foreign/jxlsave.c b/libvips/foreign/jxlsave.c index c39eb798..f762a358 100644 --- a/libvips/foreign/jxlsave.c +++ b/libvips/foreign/jxlsave.c @@ -261,7 +261,9 @@ vips_foreign_save_jxl_build( VipsObject *object ) return( -1 ); } +#ifdef HAVE_LIBJXL_JXLENCODERINITBASICINFO JxlEncoderInitBasicInfo( &jxl->info ); +#endif switch( save->ready->BandFmt ) { case VIPS_FORMAT_UCHAR: