Commit Graph

1727 Commits

Author SHA1 Message Date
Kim Woelders 0d6211c501 Drop change log from before first version tag 2022-01-18 20:31:27 +01:00
Kim Woelders cd6c00b1ce Avoid redundant operations when non-existing file has no "key" 2022-01-17 13:08:58 +01:00
Kim Woelders 9afad50f97 Simplify __imlib_FileKey()
And avoid malloc when not needed.
2022-01-17 13:06:22 +01:00
Kim Woelders 64c031acab test: Check __imlib_FileKey() 2022-01-17 13:06:16 +01:00
Kim Woelders 8891246610 PNG loader: Add multiframe support 2022-01-16 20:53:58 +01:00
Kim Woelders 5dfccd5713 PNG loader: Rewrite to use callback API
Preparing for multiframe support.
2022-01-16 20:53:58 +01:00
Kim Woelders 83f55515fb PNG loader: Disable Imlib2-Comment stuff
Not useful, AFAICT.
2022-01-16 20:53:58 +01:00
Kim Woelders 1f883a721a Add dispose-to-previous frame handling
Dispose to previous appears to be used often by apng's.
2022-01-16 20:53:58 +01:00
Kim Woelders b26150d9f4 imlib2_load: Add no-data option
Also start using stdbool for boolean stuff.
2022-01-16 20:53:31 +01:00
Kim Woelders ffbd8bbca0 SVG loader: Avoid problems when loading the module more than once
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.
2022-01-08 16:08:38 +01:00
Kim Woelders a542fb6724 Add svg loader 2022-01-08 16:08:37 +01:00
Kim Woelders 04b8c35e17 XBM loader: Correct load2() result when no header is found
Also require that the header is found within the first 30 lines in the
file.
Otherwise we may waste some time parsing large C files.
2022-01-07 21:17:50 +01:00
Kim Woelders b123cb7674 configure.ac: Correct simplification changes some more 2022-01-07 21:11:26 +01:00
Kim Woelders c109324bbf configure.ac: Correct simplification changes 2022-01-04 09:36:03 +01:00
Kim Woelders 564334d708 LZMA loader: Fix potential warning 2022-01-04 09:36:03 +01:00
Sören Tempel 7d60151ba9 ICO loader: Fix compilation on big endian architectures
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.
2022-01-03 17:29:06 +01:00
Kim Woelders 31d6d8532c imlib2_load: Verbosity twaeks 2022-01-02 12:59:24 +01:00
Kim Woelders 8f65acf7c2 imlib2_view: Verbosity twaeks 2022-01-02 12:51:24 +01:00
Kim Woelders 86e3b4fada imlib2_grab: Print error message if saving fails 2021-12-30 06:56:35 +01:00
Kim Woelders 503e8527c3 Add lzma loader 2021-12-28 16:08:06 +01:00
Kim Woelders c880edac55 BZ2, ZLIB loaders: Move duplicated code to separate file
Also change decompressors to use mmap'ed data.
2021-12-28 16:08:06 +01:00
Kim Woelders bf93574b8b Introduce more loader return codes
Used to avoid potentially wasting time trying to load corrupt images
by trying loaders which won't recognize the image anyway.
2021-12-28 16:08:06 +01:00
Kim Woelders f3db9c99b6 imlib2_view: Rework display of animated images 2021-12-28 16:07:19 +01:00
Kim Woelders 350101ff62 GIF loader: Always set BLEND flag
... always?
2021-12-28 16:06:38 +01:00
Kim Woelders 34b54a8fc2 ICO loader: Mostly cosmetic changes (inline ico_read())
Avoids unnecessary memory allocation, simplifies error handling.
2021-12-26 12:22:20 +01:00
Kim Woelders 8bc72491e8 ICO loader: Minor optimization
Or maybe not. A decent compiler would probably do this anyway.
2021-12-26 12:22:20 +01:00
Kim Woelders cbe7408bd8 test: Add a couple of ico depth test images 2021-12-26 12:22:20 +01:00
Kim Woelders 71a905d700 imlib2_view: Fix(?) animated image frame dispose handling
Still need to deal with the blend flag.
2021-12-26 11:00:14 +01:00
Kim Woelders 2bbd3dc7f9 Updates for animated image handling 2021-12-26 11:00:14 +01:00
Kim Woelders 3a93e9a92a configure.ac: Simplify loader setup 2021-12-23 17:51:24 +01:00
Kim Woelders 31d5eb6dbf autofoo/loader cosmetics
Consistently place loaders in same order.
2021-12-23 17:51:24 +01:00
Kim Woelders 40b6498281 Drop some intermediate type definitions
Not helpful, IMO.
2021-12-21 06:05:32 +01:00
Kim Woelders b28d9110e4 updates: Reduce memory usage
Apparently, sizeof(struct _tile) was 4 (gcc 11.2.1) ?!?
Weird - I think that once upon a time it was 1.
Anyway, avoid having ill defined struct size.

Also, simplify logic a bit (no need to deal with .usage as bit flags.
2021-12-21 06:05:32 +01:00
Kim Woelders f9e0e92189 Loader loading: Avoid access to uninitialized load() item 2021-12-21 06:05:18 +01:00
Kim Woelders f1bef7ae01 debug: Avoid use of uninitialized data 2021-12-21 06:05:18 +01:00
Kim Woelders 82bbd0a278 Indent 2021-12-21 06:05:18 +01:00
Kim Woelders 6ce28a9380 ICO loader: Debug tweaks 2021-12-19 14:58:43 +01:00
Kim Woelders 179d3b7e05 GIF loader: Multiframe support 2021-12-19 14:58:43 +01:00
Kim Woelders bdfcc554ed GIF loader: Some refactoring, add debug 2021-12-19 14:58:43 +01:00
Kim Woelders 7a0022684d ICO loader: Multiframe support 2021-12-19 14:58:43 +01:00
Kim Woelders b2ac97d93a WEBP loader: Multiframe support 2021-12-19 14:58:43 +01:00
Kim Woelders 549ff77b85 debug: Add DL macro for additional loader debug 2021-12-19 14:58:43 +01:00
Kim Woelders f09d3d022a imlib2_view: Add support for multiframe images 2021-12-19 14:58:43 +01:00
Kim Woelders fdd6419fe4 imlib2_load: Add support for multiframe images 2021-12-19 14:58:43 +01:00
Kim Woelders d105b29017 Enable caching for multiframe images 2021-12-19 14:58:43 +01:00
Kim Woelders 1a57db7dcb Add support for multiframe (animated) images 2021-12-19 14:58:43 +01:00
Kim Woelders d792aaa130 imlib2_view: Fix caching option
As imlib2_view did rendering via the (loader) progress callback, cached
images wouldn't be rendered.
Now, when caching is enabled, we don't use progress callbacks but render
explicitly after the image is loaded.
2021-12-19 09:32:53 +01:00
Kim Woelders 343b2041cf debug: Add some image caching debug 2021-12-19 09:32:34 +01:00
Kim Woelders b5e2bd146d imlib2_view: Tweaks around timeout 2021-12-19 09:32:34 +01:00
Kim Woelders d8e2f7a32d imlib2_view: Remove some pointless function calls 2021-12-19 09:32:13 +01:00