try to fix heifload for ubuntu 18.04

This commit is contained in:
John Cupitt 2019-03-14 13:04:26 +00:00
parent c4ce5f0084
commit 928fff5168
2 changed files with 16 additions and 0 deletions

View File

@ -927,6 +927,18 @@ if test x"$with_heif" != x"no"; then
)
fi
# exif/xmp profile support added in 1.2
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

@ -108,6 +108,7 @@ 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 );
@ -119,10 +120,12 @@ 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
VipsForeignSave *save = (VipsForeignSave *) heif;
int i;
@ -150,6 +153,7 @@ vips_foreign_save_heif_write_metadata( VipsForeignSaveHeif *heif )
return( -1 );
}
}
#endif /*HAVE_HEIF_CONTEXT_ADD_EXIF_METADATA*/
return( 0 );
}