Skip to content

Commit

Permalink
ensure we advertise uncompressed codec correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
bradh committed Oct 20, 2024
1 parent fbd5af7 commit ff443c7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions libheif/api/libheif/heif.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion tests/uncompressed_decode.cc
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,6 @@ TEST_CASE("check image handle no metadata blocks") {
}

TEST_CASE("check uncompressed is advertised") {
REQUIRE(heif_have_decoder_for_format(heif_compression_uncompressed) == true);
REQUIRE(heif_have_decoder_for_format(heif_compression_uncompressed) == (int)true);
}

0 comments on commit ff443c7

Please sign in to comment.