"Fossies" - the Fresh Open Source Software Archive

Member "libgd-2.3.2/tests/heif/heif_read.c" (6 Mar 2021, 552 Bytes) of package /linux/www/libgd-2.3.2.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 /**
    2  * Simple test case that confirms the failure of using `gdImageCreateFromHeif`
    3  * with a NULL pointer.
    4  */
    5 
    6 
    7 #include "gd.h"
    8 #include "gdtest.h"
    9 
   10 #include <libheif/heif.h>
   11 
   12 int main()
   13 {
   14     gdImagePtr im;
   15     FILE *fp;
   16 
   17     if (!gdTestAssertMsg(heif_have_decoder_for_format(heif_compression_HEVC), "HEVC codec support missing from libheif\n"))
   18         return 77;
   19 
   20     fp = gdTestFileOpen2("heif", "label.heic");
   21     gdTestAssert(fp != NULL);
   22     im = gdImageCreateFromHeif(fp);
   23     if (gdTestAssert(im != NULL))
   24         gdImageDestroy(im);
   25     fclose(fp);
   26 
   27     return gdNumFailures();
   28 }