diff --git a/libheif/api/libheif/heif.cc b/libheif/api/libheif/heif.cc index 3a328223e6..798fd5c4e4 100644 --- a/libheif/api/libheif/heif.cc +++ b/libheif/api/libheif/heif.cc @@ -2832,6 +2832,13 @@ struct heif_error heif_context_get_encoder(struct heif_context* context, int heif_have_decoder_for_format(enum heif_compression_format format) { + if (format == heif_compression_uncompressed) { +#if WITH_UNCOMPRESSED_CODEC + return true; +#else + return false; +#endif + } auto plugin = get_decoder(format, nullptr); return plugin != nullptr; } diff --git a/tests/uncompressed_decode.cc b/tests/uncompressed_decode.cc index 837619f0ba..5eb412190a 100644 --- a/tests/uncompressed_decode.cc +++ b/tests/uncompressed_decode.cc @@ -164,6 +164,7 @@ TEST_CASE("check image handle no metadata blocks") { heif_context_free(context); } - - +TEST_CASE("check uncompressed is advertised") { + REQUIRE(heif_have_decoder_for_format(heif_compression_uncompressed) == (int)true); +}