raise minimum libheif version to 1.3

We didn't compile with anything less than 1.3 anyway.

see https://github.com/libvips/libvips/issues/1817
This commit is contained in:
John Cupitt 2020-09-15 10:18:38 +01:00
parent fe7086b173
commit 0617165c66
3 changed files with 3 additions and 50 deletions

View File

@ -3,6 +3,7 @@
- better demand hint rules [kaas3000]
- fix tiff thumbnail from buffer and source [vansante]
- in jpegsave, don't set JFIF resolution if we set EXIF resolution
- bump minimum libheif version to 1.3 [lovell]
9/8/20 started 8.10.1
- fix markdown -> xml conversion in doc generation

View File

@ -834,7 +834,7 @@ AC_ARG_WITH([heif],
AS_HELP_STRING([--without-heif], [build without libheif (default: test)]))
if test x"$with_heif" != x"no"; then
PKG_CHECK_MODULES(HEIF, libheif,
PKG_CHECK_MODULES(HEIF, libheif >= 1.3.0,
[with_heif=yes
have_h265_decoder=`$PKG_CONFIG libheif --variable builtin_h265_decoder`
have_avif_decoder=`$PKG_CONFIG libheif --variable builtin_avif_decoder`
@ -852,7 +852,7 @@ if test x"$with_heif" != x"no"; then
fi
PACKAGES_USED="$PACKAGES_USED libheif"
],
[AC_MSG_WARN([libheif not found; disabling HEIF support])
[AC_MSG_WARN([libheif >= 1.3.0 not found; disabling HEIF support])
with_heif=no
have_h265_decoder=
have_h265_encoder=
@ -862,42 +862,6 @@ if test x"$with_heif" != x"no"; then
)
fi
# heif_context_set_primary_image not in 1.1
if test x"$with_heif" = x"yes"; then
save_LIBS="$LIBS"
LIBS="$LIBS $HEIF_LIBS"
AC_CHECK_FUNCS(heif_context_set_primary_image,[
AC_DEFINE(HAVE_HEIF_CONTEXT_SET_PRIMARY_IMAGE,1,
[define if you have heif_context_set_primary_image.])
],[]
)
LIBS="$save_LIBS"
fi
# heif_encoding_options_alloc not in 1.1
if test x"$with_heif" = x"yes"; then
save_LIBS="$LIBS"
LIBS="$LIBS $HEIF_LIBS"
AC_CHECK_FUNCS(heif_encoding_options_alloc,[
AC_DEFINE(HAVE_HEIF_ENCODING_OPTIONS_ALLOC,1,
[define if you have heif_encoding_options_alloc.])
],[]
)
LIBS="$save_LIBS"
fi
# exif/xmp profile support not in 1.1
if test x"$with_heif" = x"yes"; then
save_LIBS="$LIBS"
LIBS="$LIBS $HEIF_LIBS"
AC_CHECK_FUNCS(heif_context_add_exif_metadata,[
AC_DEFINE(HAVE_HEIF_CONTEXT_ADD_EXIF_METADATA,1,
[define if you have heif_context_add_exif_metadata.])
],[]
)
LIBS="$save_LIBS"
fi
# color profile support added in 1.3.3
if test x"$with_heif" = x"yes"; then
save_LIBS="$LIBS"

View File

@ -129,7 +129,6 @@ vips_foreign_save_heif_dispose( GObject *gobject )
dispose( gobject );
}
#ifdef HAVE_HEIF_CONTEXT_ADD_EXIF_METADATA
typedef struct heif_error (*libheif_metadata_fn)( struct heif_context *,
const struct heif_image_handle *,
const void *, int );
@ -141,12 +140,10 @@ struct _VipsForeignSaveHeifMetadata {
{ VIPS_META_EXIF_NAME, heif_context_add_exif_metadata },
{ VIPS_META_XMP_NAME, heif_context_add_XMP_metadata }
};
#endif /*HAVE_HEIF_CONTEXT_ADD_EXIF_METADATA*/
static int
vips_foreign_save_heif_write_metadata( VipsForeignSaveHeif *heif )
{
#ifdef HAVE_HEIF_CONTEXT_ADD_EXIF_METADATA
int i;
struct heif_error error;
@ -178,7 +175,6 @@ vips_foreign_save_heif_write_metadata( VipsForeignSaveHeif *heif )
return( -1 );
}
}
#endif /*HAVE_HEIF_CONTEXT_ADD_EXIF_METADATA*/
return( 0 );
}
@ -216,13 +212,9 @@ vips_foreign_save_heif_write_page( VipsForeignSaveHeif *heif, int page )
}
#endif /*HAVE_HEIF_COLOR_PROFILE*/
#ifdef HAVE_HEIF_ENCODING_OPTIONS_ALLOC
options = heif_encoding_options_alloc();
if( vips_image_hasalpha( heif->image ) )
options->save_alpha_channel = 1;
#else /*!HAVE_HEIF_ENCODING_OPTIONS_ALLOC*/
options = NULL;
#endif /*HAVE_HEIF_ENCODING_OPTIONS_ALLOC*/
#ifdef DEBUG
printf( "encoding ..\n" );
@ -230,16 +222,13 @@ vips_foreign_save_heif_write_page( VipsForeignSaveHeif *heif, int page )
error = heif_context_encode_image( heif->ctx,
heif->img, heif->encoder, options, &heif->handle );
#ifdef HAVE_HEIF_ENCODING_OPTIONS_ALLOC
heif_encoding_options_free( options );
#endif /*HAVE_HEIF_ENCODING_OPTIONS_ALLOC*/
if( error.code ) {
vips__heif_error( &error );
return( -1 );
}
#ifdef HAVE_HEIF_CONTEXT_SET_PRIMARY_IMAGE
if( vips_image_get_typeof( heif->image, "heif-primary" ) ) {
int primary;
@ -256,7 +245,6 @@ vips_foreign_save_heif_write_page( VipsForeignSaveHeif *heif, int page )
}
}
}
#endif /*HAVE_HEIF_CONTEXT_SET_PRIMARY_IMAGE*/
if( !save->strip &&
vips_foreign_save_heif_write_metadata( heif ) )