Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test case for uncompressed decoder advertisement #1347

Merged
merged 2 commits into from
Oct 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
5 changes: 3 additions & 2 deletions tests/uncompressed_decode.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
bradh marked this conversation as resolved.
Show resolved Hide resolved
}

Loading