diff options
author | Martin Reboredo <39890836+YakoYakoYokuYoku@users.noreply.github.com> | 2021-03-06 15:18:31 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-06 13:18:31 -0500 |
commit | 3d142367bb365316fe39ab6d1dfde527e9f1fd49 (patch) | |
tree | 77aca990971c1bbf714bd6765eb4662265e6544e /tests | |
parent | 16fab2f35a2619db636a6047e87fa8332fca6778 (diff) | |
download | libgd-3d142367bb365316fe39ab6d1dfde527e9f1fd49.tar.gz |
HEIF codecs check in test suite (#676)
Use the heif_have_decoder_for_format and heif_have_encoder_for_format
functions to find if HEVC decoding/encoding is supported by libheif.
Fixes #675.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/heif/heif_im2im.c | 5 | ||||
-rw-r--r-- | tests/heif/heif_read.c | 5 |
2 files changed, 10 insertions, 0 deletions
diff --git a/tests/heif/heif_im2im.c b/tests/heif/heif_im2im.c index 6ab9cf6..202d6b3 100644 --- a/tests/heif/heif_im2im.c +++ b/tests/heif/heif_im2im.c @@ -7,6 +7,8 @@ #include "gd.h" #include "gdtest.h" +#include <libheif/heif.h> + int main() { gdImagePtr src, dst; @@ -15,6 +17,9 @@ int main() int size = 0; CuTestImageResult result = {0, 0}; + if (!gdTestAssertMsg(heif_have_decoder_for_format(heif_compression_HEVC) && heif_have_encoder_for_format(heif_compression_HEVC), "HEVC codec support missing from libheif\n")) + return 77; + src = gdImageCreateTrueColor(100, 100); gdTestAssertMsg(src != NULL, "could not create src\n"); /* libheif seems to have some rounding issues */ diff --git a/tests/heif/heif_read.c b/tests/heif/heif_read.c index 469ea31..6ecb5f0 100644 --- a/tests/heif/heif_read.c +++ b/tests/heif/heif_read.c @@ -7,11 +7,16 @@ #include "gd.h" #include "gdtest.h" +#include <libheif/heif.h> + int main() { gdImagePtr im; FILE *fp; + if (!gdTestAssertMsg(heif_have_decoder_for_format(heif_compression_HEVC), "HEVC codec support missing from libheif\n")) + return 77; + fp = gdTestFileOpen2("heif", "label.heic"); gdTestAssert(fp != NULL); im = gdImageCreateFromHeif(fp); |