Guilherme Janczak
84314f013f
remove bad unused function
...
__imlib_FileCanRead() suffers from TOCTTOU issues. The file behind the
path it takes as a parameter can change while the function executes, and
also between the function's return and the caller's use of the path.
The function is also unused, so just delete it.
2023-02-04 04:17:57 +00:00
Kim Woelders
829632a735
__imlib_FileDir(): Fix missing closedir() on OOM
...
Noted by NRK.
And some cosmetics.
2023-01-31 19:32:03 +01:00
Kim Woelders
5c226954c1
ANI, PNG, TGA loaders: Enable handling of unaligned data
...
Fixes warnings seen with -fsanitize=undefined when using
--enable-packed.
2023-01-29 10:25:08 +01:00
Kim Woelders
d27354926a
Loaders: Avoid cast-align warnings with -Wcast-align=strict
2023-01-29 10:25:08 +01:00
Kim Woelders
6337c54d30
ANI loader: Use struct to access chunk data
2023-01-28 16:25:15 +01:00
Kim Woelders
495fb5e6f8
Loaders: Debug macro cleanups
2023-01-28 16:25:15 +01:00
Kim Woelders
8c6c40097e
x11_rgba: Avoid cast-align warnings with -Wcast-align=strict
...
Just silencing the warnings, assuming things are properly aligned.
2023-01-28 16:16:17 +01:00
Kim Woelders
09bb1a1c4c
x11_grab: Avoid cast-align warnings with -Wcast-align=strict
...
Just silencing the warnings, assuming things are properly aligned.
2023-01-28 16:16:17 +01:00
Kim Woelders
a910b58242
x11_rgba: Add missing const
...
Also add missing header.
2023-01-28 16:16:17 +01:00
Kim Woelders
00dcf6851f
PNM saver: Write images with alpha as P7 PAM RGB_ALPHA type
...
The previously used P8 type seems to be known only by imlib2.
2023-01-22 17:20:01 +01:00
Kim Woelders
c8dcabc62a
PNM loader: Speedups
...
Eliminate copy of data to intermediary buffer.
2023-01-22 09:20:07 +01:00
Kim Woelders
ac4fb5e21f
imlib2_view: Be more verbose about load errors
2023-01-14 10:47:12 +01:00
Kim Woelders
66a5e03de6
imlib2_load: Show error on deferred data load problem
2023-01-14 10:47:12 +01:00
Kim Woelders
930243411e
api: Remember error on deferred image data loads
...
Now it can be fetched with imlib_get_error().
2023-01-14 10:47:12 +01:00
Kim Woelders
a856571312
Drop some redundant calls to __imlib_LoadImageData()
2023-01-14 10:47:12 +01:00
Kim Woelders
5d1083858c
image: Let __imlib_CreateImage() allocate pixel data buffer
...
..and check dimensions.
Does simplify things nicely.
2023-01-14 08:59:32 +01:00
Kim Woelders
5d16eb8bb8
api: Tweak/correct error handling in drawable grabbing functions
...
imlib_create_scaled_image_from_drawable() now returns NULL if the
drawable could not be grabbed, just as imlib_create_image_from_drawable()
has always done.
2023-01-14 08:59:32 +01:00
Kim Woelders
dafd7eb33d
api: Change some parameter names
...
- Shorten some names - mostly to avoid some line wrapping
source_... -> src_...
destination_... -> dst_...
- Change some parameter names for consistency/clarity
Change (x, y, width, height) to (src_x, src_y, src_width, src_height)
or (dst_x, dst_y, dst_width, dst_height) a couple of places.
2023-01-14 08:59:17 +01:00
Kim Woelders
a4e240bc96
api: Fix code duplication around some __imlib_BlendImageToImage() calls
2023-01-13 16:19:02 +01:00
Kim Woelders
207cffb207
Avoid some more undefined behaviors with shifts
2023-01-13 10:55:47 +01:00
NRK
e76d9bcf9f
PNM loader: avoid some undefined behavior
...
`ptr` is a `uint8_t` pointer, which will get promoted to an `int` due to
integer promotion. and shifting a signed int by 24 places could cause
signed overflow which is undefined.
> If E1 has a signed type and nonnegative value, and E1 x 2^E2 is
> representable in the result type, then that is the resulting value;
> otherwise, the behavior is undefined.
ref: https://port70.net/~nsz/c/c99/n1256.html#6.5.7p4
2023-01-13 10:55:47 +01:00
q3cpma
27db42330e
PNM loader: add read support for PAM
2023-01-12 22:14:03 +01:00
Kim Woelders
03e4460c17
ANI loader: Multiframe suport
2022-12-14 19:33:09 +01:00
Kim Woelders
7e7eae168a
ANI loader: Disable progress in embed loader
2022-12-14 19:33:09 +01:00
Kim Woelders
19028a4ca3
image: Cosmetics (slightly more consisent naming)
2022-12-08 19:03:41 +01:00
Kim Woelders
68a5af8cb2
Add new ani loader
2022-12-08 17:46:09 +01:00
Kim Woelders
108af6d186
image: Introduce __imlib_LoadEmbeddedMem()
2022-12-07 20:03:18 +01:00
Kim Woelders
b7d4cab412
image: Cosmetics
...
- Remove unused function argument in __imlib_ImageFileContextPush()
- Swap function arguments in __imlib_LoadEmbedded()
2022-12-07 20:03:18 +01:00
Kim Woelders
472c823aaf
imlib2_view: Don't load bad images twice if first or last in argument list
2022-12-07 18:41:05 +01:00
Kim Woelders
bce3ca564d
imlib2_view: Properly handle caching vs progress callbacks
...
When viewing animated images using progress callbacks we could
unintentionally cache a frame, causing incorrect rendering.
2022-12-07 18:40:43 +01:00
Kim Woelders
dbeff07758
imlib2_view: Deal with all pending X events at once
...
Sometimes processing of e.g. key events were deferred do to frame
handling.
2022-11-21 18:56:17 +01:00
Kim Woelders
84948cb698
imlib2_view: Fix multiframe after update coordinate change
2022-11-21 18:49:19 +01:00
Kim Woelders
2d2f8899ec
multiframe: Remove frame offset from updates
...
The frame offsets were recently removed from the loader update callbacks
and added in the infrastructure before calling the user update function.
Now drop the frame offsets so that the update coordinates are relative
to the frame, not the canvas.
Should make things simpler in the end.
2022-11-21 18:49:19 +01:00
Kim Woelders
bfcaff3976
imlib2_view: Fix multiframe rendering detail
...
On dispose, we must re-render saved before saving next.
2022-11-21 18:49:19 +01:00
Kim Woelders
a5daa9e33c
PNG loader: Simplify update callback handling
2022-11-21 18:49:19 +01:00
Kim Woelders
5a1b88547a
PNG loader: Quit after loading first frame
...
.. in the IDAT data case too.
2022-11-21 18:49:19 +01:00
Kim Woelders
ee4b02016e
PNG loader: Quit scan when target fdAT is seen
2022-11-21 18:49:19 +01:00
Kim Woelders
b6bf5d0520
multiframe: Allocate frame info only when needed
2022-11-15 11:54:06 +01:00
Kim Woelders
e353a684c2
multiframe: Move frame info to allocated record
...
Avoid the overhead in ImlibImage when not doing multiframe loads.
2022-11-15 11:54:06 +01:00
Kim Woelders
b1bbe1d9e8
multiframe: Centralize handling of frame update offsets
2022-11-15 11:54:06 +01:00
Kim Woelders
6df68e3e2e
multiframe: Tweaks around frame number handling
2022-11-15 11:54:06 +01:00
Kim Woelders
0071544859
PS loader: Cosmetics
2022-11-15 11:54:06 +01:00
Kim Woelders
9382d8f2e4
PNG loader: Cosmetics
...
In multiframe loaders, use "frame" for the requested frame, and "fcount"
for frame counter.
2022-11-15 11:53:52 +01:00
Kim Woelders
c6d394075d
imlib2_view: Fix single frame update rendering
2022-11-15 11:49:40 +01:00
Kim Woelders
37332eb35e
autofoo: Use AC_USE_SYSTEM_EXTENSIONS
...
Defining _GNU_SOURCE is then not needed.
2022-11-11 12:05:04 +01:00
Kim Woelders
9b198f0af9
ICO loader: Eliminate ico_load()
...
Not really helpful.
2022-10-31 07:21:00 +01:00
Kim Woelders
61f055c4e7
SVG loader: Don't reference multiframe stuff
...
No multiframe handling here.
2022-10-31 07:19:43 +01:00
Kim Woelders
f762a49c49
PNG loader: Fix animated PNG loading some more
2022-10-12 19:30:44 +02:00
Kim Woelders
6e2267e740
multiframe: Support loop count
2022-10-10 17:23:43 +02:00
Kim Woelders
272c737cc3
PNG loader: Improved handling of animated PNGs
...
Correct handling of initial image (IDAT vs fcTL order).
2022-10-10 17:23:43 +02:00