- Always include config.h before Imlib2.h
Needed for X_DISPLAY_MISSING.
- Always include config.h and Imlib2.h first
Should make it more likely to spot stuff missing but required
in Imlib2.h, like stddef.h.
gtest.h apparently must be included before X headers though.
- Make sure we use the Imlib2.h here and not the one in /usr/include
Also ensure that the tests build when building without X.
Although configure can be called to ignore x headers, eventually the
compilation of api_obsolete.c fails because the configuration results
in config.h are not evaluated.
For successful compilation with `./configure --without-x` and adding
config.h I also needed stddef.h, which is added as well.
this prevents the loader from spending unreasonable amount of time going
through the entire file in case someone opens a directory which might
contain large videos or files.
Warning seems to be incorrect though..
In function ‘__imlib_stripwhitespace’,
inlined from ‘__imlib_script_parse’ at ../../../../src/lib/script.c:256:21:
../../../../src/lib/script.c:53:4: error: pointer may be used after ‘free’ [-Werror=use-after-free]
53 | strcpy(str, tmpstr);
| ^~~~~~~~~~~~~~~~~~~
../../../../src/lib/script.c:54:4: note: call to ‘free’ here
54 | free(tmpstr);
| ^~~~~~~~~~~~
Although the warning is technically correct it is not a problem as the
address is just used to match if an ImlibImagePixmap references it.
../../../../src/lib/image.c: In function ‘__imlib_ConsumeImage’:
../../../../src/lib/image.c:111:4: error: pointer ‘im’ used after ‘free’ [-Werror=use-after-free]
111 | __imlib_PixmapUnrefImage(im);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../../../src/lib/image.c:108:4: note: call to ‘free’ here
108 | free(im);
| ^~~~~~~~
- No need to check fileno
Should be valid on entry
- No need for stat()
File size is passed via im
- Call __imlib_FreeData() on error like the other loaders do
Summary: Implemented a loader for HEIF images. Uses libheif, and implemented the `load2` function as of now
Reviewers: raster
Subscribers: Colocasian, eworm, kwo
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D12267
gcc 11.2.1 with -pedantic:
image.c: In function ‘__imlib_LoadImage’:
image.c:567:9: error: a label can only be part of a statement and a declaration is not a statement [-Werror=pedantic]
567 | ImlibLoader ** loaders = __imlib_GetLoaderList();
clang 13.0.0:
image.c:567:9: error: expected expression
ImlibLoader ** loaders = __imlib_GetLoaderList();
^
Also remove pointless self-assignment.