Skip to content

Commit

Permalink
heifsave: check availability of heif_encoder_parameter_get_valid_inte…
Browse files Browse the repository at this point in the history
…ger_values (libvips#4194)
  • Loading branch information
lovell authored Oct 11, 2024
1 parent 1a21cba commit 19b499d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions libvips/foreign/heifsave.c
Original file line number Diff line number Diff line change
Expand Up @@ -620,6 +620,7 @@ vips_foreign_save_heif_build(VipsObject *object)
return -1;
}

#ifdef HAVE_HEIF_ENCODER_PARAMETER_GET_VALID_INTEGER_VALUES
for (param = heif_encoder_list_parameters(heif->encoder);
*param; param++) {
int have_minimum;
Expand All @@ -645,6 +646,7 @@ vips_foreign_save_heif_build(VipsObject *object)
return -1;
}
}
#endif /*HAVE_HEIF_ENCODER_PARAMETER_GET_VALID_INTEGER_VALUES*/

/* TODO .. support extra per-encoder params with
* heif_encoder_list_parameters().
Expand Down
4 changes: 4 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -548,6 +548,10 @@ if libheif_dep.found()
if libheif_dep.version().version_compare('>=1.7.0')
cfg_var.set('HAVE_HEIF_AVIF', '1')
endif
# added in 1.10.0
if cpp.has_function('heif_encoder_parameter_get_valid_integer_values', prefix: '#include <libheif/heif.h>', dependencies: libheif_dep)
cfg_var.set('HAVE_HEIF_ENCODER_PARAMETER_GET_VALID_INTEGER_VALUES', '1')
endif
# added in 1.11.0
if cpp.has_member('struct heif_encoding_options', 'output_nclx_profile', prefix: '#include <libheif/heif.h>', dependencies: libheif_dep)
cfg_var.set('HAVE_HEIF_ENCODING_OPTIONS_OUTPUT_NCLX_PROFILE', '1')
Expand Down

0 comments on commit 19b499d

Please sign in to comment.