From 928fff5168ba1468f7e96b0737f835c961346613 Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Thu, 14 Mar 2019 13:04:26 +0000 Subject: [PATCH] try to fix heifload for ubuntu 18.04 --- configure.ac | 12 ++++++++++++ libvips/foreign/heifsave.c | 4 ++++ 2 files changed, 16 insertions(+) diff --git a/configure.ac b/configure.ac index 48960a41..d0cac8b5 100644 --- a/configure.ac +++ b/configure.ac @@ -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" diff --git a/libvips/foreign/heifsave.c b/libvips/foreign/heifsave.c index d9493ba6..8187a467 100644 --- a/libvips/foreign/heifsave.c +++ b/libvips/foreign/heifsave.c @@ -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 ); }