- 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.
It appears that the svg loader fails when dlopen'ed a second time,
presumably due to some issue in librsvg2:
thread '<unnamed>' panicked at 'Type RsvgHandle has already been registered', /builddir/build/BUILD/librsvg-2.52.4/vendor/glib/src/subclass/types.rs:751:13
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
fatal runtime error: failed to initiate panic, error 5
A second load of a loader will only happen if an application calls
imlib_flush_loaders(), which I don't see why regular applications would
need to do.
However, calling imlib_flush_loaders() shouldn't cause applications to
potentially fail (abort) anyway.
The failure can be avoided by dlopen'ing with RTLD_NODELETE, but that
would apply to all loaders, which doesn't seem right.
With the solution here the svg.so module is marked to be un-unloadable
which seems to solve the problem and doesn't affect other modules.
Commit ff79901a07 refactors the
ico_read_idir function and removed the local nr variable. Unfortunately,
this variable is still used within an `#ifdef WORDS_BIGENDIAN` block on
big endian architectures as a for loop index variable. As such, the code
does presently not compile since the aforementioned commit. This patch
fixes this issue by re-introducing the variable conditionally on big
endian architectures.
Note: It would likely be cleaner to declare the nr variable as part of
the loop declaration, however, this C99 feature does not seem to be used
anywhere in the code base, hence I refrained from using it here.