Commit Graph

349 Commits

Author SHA1 Message Date
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 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
Kim Woelders 75657f0362 PNG loader: Cosmetics 2022-10-10 15:55:11 +02:00
Kim Woelders 8cdb260368 PNG loader: Correct frame delay in zero denominator case 2022-10-10 15:55:11 +02:00
NRK e9c09deb08 TGA loader: fix indexing in tgaflip
`y` needs to be multiplied by the width, not the height.

ref: https://codeberg.org/nsxiv/nsxiv/issues/378
2022-10-09 17:49:21 +02:00
Kim Woelders ecf119af57 J2K loader: Drop showing deprecated item in debug message 2022-08-27 17:51:07 +02:00
Kim Woelders 96e95920dc Enable disabling filter functions
To optionally reduce footprint.
2022-08-26 06:33:32 +02:00
Kim Woelders 753065d5a3 loading: Centralize mmap handling
Loader interface should be stable now.
2022-07-10 12:51:06 +02:00
Kim Woelders e55208f4d6 loading: Introduce __imlib_ImageFileContextPush/Pop()
Makes dealing with nested file contexts much easier.
2022-07-10 12:50:40 +02:00
Kim Woelders 5b357a815b loading: New loader infrastructure
Old loaders will no longer work.
Should be no big deal to migrate though.
2022-07-10 12:50:40 +02:00
Kim Woelders b39d33c800 image: Change has alpha flag to separate byte
It is the only flag that should be used by the loaders
2022-07-10 12:50:40 +02:00
Kim Woelders f44e52c62d Introduce Imlib2_Loader.h - all that is needed by loaders
Note! This changes breaks loader ABI due to reordering of elements in
ImlibImage.
Loader interface will be unstable until further notice.
2022-07-10 12:50:09 +02:00
Kim Woelders f756d91c31 TIFF loader: Change default save compression type
As of libtiff 4.4.0 saving an image with COMPRESSION_DEFLATE will
produce a warning:

 TIFFWriteDirectorySec: Warning, Creating TIFF with legacy Deflate codec identifier,
 COMPRESSION_ADOBE_DEFLATE is more widely supported.

So let's just use COMPRESSION_ADOBE_DEFLATE.
2022-06-30 09:38:02 +02:00
Kim Woelders 33ab86c10f JPEG loader: Use mmap'ed file access
Doesn't seem to affect speed much.
2022-05-10 16:08:44 +02:00
Kim Woelders 65cb3e33e3 SVG loader: Fix size when unit is percent some more
Non-debug case too..
2022-04-21 10:11:32 +02:00
Kim Woelders 2d31bab355 SVG loader: Fix size when unit is percent
Also consistently use lrint() instead of ceil() on FP values.
2022-04-18 20:14:09 +02:00
Kim Woelders e35b4dca6c SVG loader: Avoid some warnings in rsvg.h 2022-04-18 20:09:36 +02:00
Kim Woelders 31f0935707 JXL loader: Multiframe support
Does not work very well.
Looks like the time needed to render the N'th frame (from scratch) is
proportional to N, so reasonable performance would require the frames
to be generated sequentially while decoding the image.
2022-04-13 19:53:03 +02:00
Kim Woelders 59eae5643e Add PS/EPS loader using libspectre 2022-04-11 08:25:48 +02:00
Kim Woelders 9ebd8399d2 Add J2K (JPEG 2000) loader using openjpeg2 library 2022-04-10 12:45:23 +02:00
Kim Woelders 11806ddb74 SVG loader: Faster signature check
Faster (when failing) than letting librsvg2 do it.
2022-04-09 17:17:58 +02:00
Kim Woelders c40c222b9c Revert a couple of unintended changes 2022-04-07 12:37:36 +02:00
Kim Woelders 323a95cd4e Add jxl loader 2022-04-02 20:18:56 +02:00
Kim Woelders 63dccd46c5 TIFF loader: Use mmap'ed file access
Doesn't seem to affect speed much.
2022-04-02 02:20:30 +02:00
Kim Woelders 2255a119d8 SVG loader: Requires librsvg-2.46 2022-04-02 02:20:30 +02:00
Kim Woelders 3aeceb6a7b Loaders: Remove unnecessary calls to __imlib_FreeData()
__imlib_LoadImageWrapper() does it when required so no need for
doing it in every loader.
2022-03-31 21:49:56 +02:00
Kim Woelders 51f683c0c6 Loaders: Some trivial cosmetics 2022-03-31 20:47:36 +02:00
Kim Woelders 771ff09c29 GIF loader: Use mmap'ed file access
Seems to be ~4% faster.
2022-03-29 06:54:55 +02:00
Kim Woelders 90fac1f53d GZ loader: Fix uncompressor exit code 2022-03-29 06:54:55 +02:00
Kim Woelders 18d0befc57 Use stdint types instead of DATA32 etc.
This should make things slightly more consistent and unambiguous, and
the stdint types are already used here and there (in loaders).

I'm not aware of any systems where this change makes any difference.
If there are targets out there with 64 bit ints imlib2 might now work
there and on targets with 16 bit ints it most likely still doesn't.
2022-03-26 15:54:40 +01:00
Kim Woelders 7b671819f6 WEBP saver: Fix return code on success 2022-03-18 20:54:50 +01:00
Kim Woelders 32a1c3ae19 Merge __imlib_FindBestLoader...() functions
And move a few loader related function protoptypes again.
2022-03-12 14:48:32 +01:00
Kim Woelders 05f454a89d Introduce __imlib_GetKey() 2022-03-12 13:26:08 +01:00
Kim Woelders fa46dde05b ID3 loader: Disable tags stuff
I don't understand the purpose, and it gets in the way of changes to come.
2022-03-12 13:02:18 +01:00
Kim Woelders ddbb233591 ID3 loader: Drop inline and likely stuff
I think it's unlikely these contribute any measurable speedups.
2022-03-11 17:00:47 +01:00
Kim Woelders e8e0130ce0 TIFF loader: Remove obsolete comment 2022-03-11 16:59:29 +01:00
Youssef Rebahi-Gilbert e415e0364c fix: possible memleak in rgba save on big endian systems 2022-03-07 21:45:18 +01:00
Kim Woelders 97b3aa9b9b Introduce types.h
Avoiding more conveluted header file inclusion order issues.
2022-03-07 08:01:37 +01:00
Kim Woelders 46dc96436a Remove system includes from common.h
Avoiding obscure include order problems.
2022-03-07 08:01:19 +01:00
Kim Woelders c7bd5641e3 Move some loader related function prototypes to loaders.h 2022-03-06 18:42:28 +01:00
Kim Woelders 3459740001 Loader includes tweaks 2022-03-06 18:42:28 +01:00