split heifload / heifsave

test for libheif supporting decode and encode, and turn heifload and
heifsave on and off
This commit is contained in:
John Cupitt 2019-05-08 21:13:00 +01:00
parent b680d9f833
commit 3e60e816ed
4 changed files with 22 additions and 8 deletions

View File

@ -928,12 +928,23 @@ AC_ARG_WITH([heif],
if test x"$with_heif" != x"no"; then
PKG_CHECK_MODULES(HEIF, libheif,
[AC_DEFINE(HAVE_HEIF,1,[define if you have libheif installed.])
with_heif=yes
[with_heif=yes
have_h265_decoder=`$PKG_CONFIG libheif --variable builtin_h265_decoder`
if test x"$have_h265_decoder" = x"yes"; then
AC_DEFINE(HAVE_HEIF_DECODER,1,
[define if your libheif has decode support.])
fi
have_h265_encoder=`$PKG_CONFIG libheif --variable builtin_h265_encoder`
if test x"$have_h265_encoder" = x"yes"; then
AC_DEFINE(HAVE_HEIF_ENCODER,1,
[define if your libheif has encode support.])
fi
PACKAGES_USED="$PACKAGES_USED libheif"
],
[AC_MSG_WARN([libheif not found; disabling HEIF support])
with_heif=no
have_h265_decoder=
have_h265_encoder=
]
)
fi

View File

@ -2034,14 +2034,17 @@ vips_foreign_operation_init( void )
vips_foreign_save_nifti_get_type();
#endif /*HAVE_NIFTI*/
#ifdef HAVE_HEIF
#ifdef HAVE_HEIF_DECODER
vips_foreign_load_heif_get_type();
vips_foreign_load_heif_file_get_type();
vips_foreign_load_heif_buffer_get_type();
#endif /*HAVE_HEIF_DECODER*/
#ifdef HAVE_HEIF_ENCODER
vips_foreign_save_heif_get_type();
vips_foreign_save_heif_file_get_type();
vips_foreign_save_heif_buffer_get_type();
#endif /*HAVE_HEIF*/
#endif /*HAVE_HEIF_ENCODER*/
vips__foreign_load_operation =
g_quark_from_static_string( "vips-foreign-load-operation" );

View File

@ -50,7 +50,7 @@
#include <vips/debug.h>
#include <vips/internal.h>
#ifdef HAVE_HEIF
#ifdef HAVE_HEIF_DECODER
#include <libheif/heif.h>
@ -919,7 +919,7 @@ vips_foreign_load_heif_buffer_init( VipsForeignLoadHeifBuffer *buffer )
{
}
#endif /*HAVE_HEIF*/
#endif /*HAVE_HEIF_DECODER*/
/**
* vips_heifload:

View File

@ -48,7 +48,7 @@
#include <vips/vips.h>
#include <vips/internal.h>
#ifdef HAVE_HEIF
#ifdef HAVE_HEIF_ENCODER
#include <libheif/heif.h>
@ -568,7 +568,7 @@ vips_foreign_save_heif_buffer_init( VipsForeignSaveHeifBuffer *buffer )
{
}
#endif /*HAVE_HEIF*/
#endif /*HAVE_HEIF_ENCODER*/
/**
* vips_heifsave: (method)