set CFLAGS for magick API detect

since it will try to compile and link code fragments
This commit is contained in:
John Cupitt 2021-07-29 13:12:29 +01:00
parent 86466a9b9a
commit b4582dbdaa
2 changed files with 25 additions and 7 deletions

View File

@ -620,12 +620,17 @@ if test x"$magick6" = x"yes"; then
fi
if test x"$magick6" = x"yes"; then
# the magick6 API varies a lot between magick versions, and between GM and
# IM
# the magick6 API varies a lot between magick versions, and between GM and IM
# set CFLAGS too, since CHECK_FUNCS will try to compile / link / run code.
save_LIBS="$LIBS"
save_CFLAGS="$CFLAGS"
LIBS="$LIBS $MAGICK_LIBS"
CFLAGS="$CFLAGS $MAGICK_CFLAGS"
AC_CHECK_FUNCS([InheritException AcquireExceptionInfo SetImageProperty SetImageExtent AcquireImage GetVirtualPixels ResetImageProfileIterator ResetImageAttributeIterator ResetImagePropertyIterator MagickCoreGenesis SetImageOption BlobToStringInfo OptimizePlusImageLayers OptimizeImageTransparency])
LIBS="$save_LIBS"
CFLAGS="$save_CFLAGS"
fi
if test x"$magick6" = x"yes"; then
@ -1597,7 +1602,7 @@ Matlab load with matio: $with_matio
NIfTI load/save with niftiio: $with_nifti
FITS load/save with cfitsio: $with_cfitsio
Magick package: $with_magickpackage (dynamic module: $with_magick_module)
Magick API version: $magick_version
Magick major API version: $magick_version
load with libMagickCore: $enable_magickload
save with libMagickCore: $enable_magicksave
])

View File

@ -32,9 +32,9 @@
*/
/*
*/
#define DEBUG_VERBOSE
#define DEBUG
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
@ -200,6 +200,11 @@ vips_foreign_load_jxl_fill_input( VipsForeignLoadJxl *jxl,
{
gint64 bytes_read;
#ifdef DEBUG_VERBOSE
printf( "vips_foreign_load_jxl_fill_input: %zd bytes requested\n",
INPUT_BUFFER_SIZE - bytes_remaining );
#endif /*DEBUG_VERBOSE*/
memcpy( jxl->input_buffer,
jxl->input_buffer + jxl->bytes_in_buffer - bytes_remaining,
bytes_remaining );
@ -365,13 +370,19 @@ vips_foreign_load_jxl_process( VipsForeignLoadJxl *jxl )
{
JxlDecoderStatus status;
#ifdef DEBUG
printf( "vips_foreign_load_jxl_process: starting ...\n" );
#endif /*DEBUG*/
while( (status = JxlDecoderProcessInput( jxl->decoder )) ==
JXL_DEC_NEED_MORE_INPUT ) {
size_t bytes_remaining;
bytes_remaining = JxlDecoderReleaseInput( jxl->decoder );
if( vips_foreign_load_jxl_fill_input( jxl, bytes_remaining ) )
if( vips_foreign_load_jxl_fill_input( jxl, bytes_remaining ) ) {
printf( "vips_foreign_load_jxl_process: EOF\n" );
return( JXL_DEC_ERROR );
}
JxlDecoderSetInput( jxl->decoder,
jxl->input_buffer, jxl->bytes_in_buffer );
@ -554,7 +565,8 @@ vips_foreign_load_jxl_header( VipsForeignLoad *load )
break;
case JXL_DEC_COLOR_ENCODING:
if( JxlDecoderGetICCProfileSize( jxl->decoder,
if( JXL_DEC_SUCCESS != JxlDecoderGetICCProfileSize(
jxl->decoder,
&jxl->format,
JXL_COLOR_PROFILE_TARGET_DATA,
&jxl->icc_size ) ) {
@ -571,7 +583,8 @@ vips_foreign_load_jxl_header( VipsForeignLoad *load )
jxl->icc_size )) )
return( -1 );
if( JxlDecoderGetColorAsICCProfile( jxl->decoder,
if( JXL_DEC_SUCCESS != JxlDecoderGetColorAsICCProfile(
jxl->decoder,
&jxl->format,
JXL_COLOR_PROFILE_TARGET_DATA,
jxl->icc_data, jxl->icc_size ) ) {