Merge branch '8.10'

This commit is contained in:
John Cupitt 2020-09-15 10:20:15 +01:00
commit a88c88bb7b
3 changed files with 3 additions and 50 deletions

View File

@ -9,6 +9,7 @@
- better demand hint rules [kaas3000] - better demand hint rules [kaas3000]
- fix tiff thumbnail from buffer and source [vansante] - fix tiff thumbnail from buffer and source [vansante]
- in jpegsave, don't set JFIF resolution if we set EXIF resolution - 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 9/8/20 started 8.10.1
- fix markdown -> xml conversion in doc generation - fix markdown -> xml conversion in doc generation

View File

@ -848,7 +848,7 @@ AC_ARG_WITH([heif],
AS_HELP_STRING([--without-heif], [build without libheif (default: test)])) AS_HELP_STRING([--without-heif], [build without libheif (default: test)]))
if test x"$with_heif" != x"no"; then if test x"$with_heif" != x"no"; then
PKG_CHECK_MODULES(HEIF, libheif, PKG_CHECK_MODULES(HEIF, libheif >= 1.3.0,
[with_heif=yes [with_heif=yes
have_h265_decoder=`$PKG_CONFIG libheif --variable builtin_h265_decoder` have_h265_decoder=`$PKG_CONFIG libheif --variable builtin_h265_decoder`
have_avif_decoder=`$PKG_CONFIG libheif --variable builtin_avif_decoder` have_avif_decoder=`$PKG_CONFIG libheif --variable builtin_avif_decoder`
@ -866,7 +866,7 @@ if test x"$with_heif" != x"no"; then
fi fi
PACKAGES_USED="$PACKAGES_USED libheif" 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 with_heif=no
have_h265_decoder= have_h265_decoder=
have_h265_encoder= have_h265_encoder=
@ -876,42 +876,6 @@ if test x"$with_heif" != x"no"; then
) )
fi 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 # color profile support added in 1.3.3
if test x"$with_heif" = x"yes"; then if test x"$with_heif" = x"yes"; then
save_LIBS="$LIBS" save_LIBS="$LIBS"

View File

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