Commit Graph

109 Commits

Author SHA1 Message Date
Kim Woelders ed89effcf3 api: error_return adjustments
- Drop imlib_load_image_fde()
- Remove error_return from imlib_load_image_mem()

It is becoming somewhat messy having functions with and without error
returns, so drop error returns in API functions added since v1.9.1.
Use imlib_get_error() to get the error instead.
2022-09-30 06:08:29 +02:00
Kim Woelders 43c54e1345 Introduce imlib_get_error()
Some of the image loading functions have a version with an error_return,
and some not.
With imlib_get_error() it is now possible to fetch the load error for
any image loading function call.
2022-09-30 06:04:27 +02:00
Kim Woelders 51906190a1 image: Don't munmap external memory
When loading image from memory (imlib_load_image[_frame]_mem()) the
memory was unintentionally munmapped after loading.

This would cause trouble if loading multiple times from the same mmap'ed
memory, but not from malloced memory as the munmap would then just fail
silently.

old/legacy-imlib2#1
2022-09-29 13:48:46 +02:00
Kim Woelders 9f9779e698 test: Re-generate test images with recent tool/library versions
Converters and library versions used:
 convert                ImageMagick-6.9.12.64
 cjxl                   libjxl-0.7.0
 heif-enc               libheif-1.13.0
 opj2_compress          openjpeg2-2.5.0
 pnmtopnm,pamtoxvmini   netpbm-10.99.00
2022-09-28 18:19:07 +02:00
Kim Woelders 87bcf92524 Includes tweaks
- Drop unneeded errno.h includes.
- Include stdarg.h only where needed.
2022-09-28 18:19:07 +02:00
Kim Woelders af587674a4 Introduce imlib_load_image_mem()
For loading images from memory.
2022-07-10 12:51:15 +02:00
Kim Woelders cea1207efe Introduce imlib_load_image_fde()
Same as imlib_load_image_fd() but with error return.
2022-07-07 12:59:40 +02:00
Kim Woelders 90824fc2fd test: Add test_misc 2022-06-24 21:33:23 +02:00
Kim Woelders 416f847dc3 Introduce strsplit() 2022-06-23 07:36:23 +02:00
Kim Woelders ee862ac6bf test: Add some of JPEG 2000 tests 2022-04-10 12:48:25 +02:00
Kim Woelders e8b564f141 build: Tweaks
- Let test depend on src
- Run tests sequentially
2022-04-09 17:19:19 +02:00
Kim Woelders c13f4ddf65 test_save: Updates
Catch various issues related to
- loader caching
- loader lookup for saving
- deferred loading in connection with saving
2022-04-07 11:29:22 +02:00
Kim Woelders 766c9d096f test: Add basic jxl test 2022-04-02 20:18:56 +02:00
Kim Woelders ac0d69863b test_load: Check deferred loading too 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 bc9867379c Deprecate imlib_load/save_image_with_error_return() 2022-03-21 10:11:02 +01:00
Kim Woelders 4bf622173c Switch to imlib_load/save_image_with_errno_return() 2022-03-21 10:09:18 +01:00
Kim Woelders bf07b104f3 Image load: Change error code on zero file size
From IMLIB_LOAD_ERROR_UNKNOWN to IMLIB_LOAD_ERROR_IMAGE_READ.

Mostly to get the same error from loading a 0 byte file as any other too
short file.
2022-03-19 17:25:54 +01:00
Kim Woelders 16cda0cc97 test: Properly include test.h in test SOURCES 2022-03-15 13:26:33 +01:00
Kim Woelders b0f3bfc907 test_grab: Enable testing depths other than 24 and 32
Also test with/without using a mask when grabbing (just a "full" one for
now to hit different grabber paths).
2022-03-07 21:46:56 +01:00
Kim Woelders f334da7959 test: Command line options tweak 2022-03-07 21:46:56 +01:00
Kim Woelders ac1d4b0520 Deal consistently with including Imlib2.h
- 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.
2022-03-03 07:35:39 +01:00
Kim Woelders 79a5086b58 test: Merge common stuff 2022-02-06 13:07:47 +01:00
Kim Woelders 68171bdf7c test: Add basic heif loader check 2022-01-29 19:59:47 +01:00
Kim Woelders dde8b3fcd1 test: Add some more PNM type loading tests
Also avoid that .gz file contents depend on contained file's time stamp.
2022-01-19 19:38:32 +01:00
Kim Woelders 10f692c946 test: Add makefile to generate test images 2022-01-18 20:42:13 +01:00
Kim Woelders da2ce0d94b test: Move generated image files out of source dir
Simplifies cleaning up.
2022-01-18 20:40:59 +01:00
Kim Woelders 64c031acab test: Check __imlib_FileKey() 2022-01-17 13:06:16 +01:00
Kim Woelders a542fb6724 Add svg loader 2022-01-08 16:08:37 +01:00
Kim Woelders 503e8527c3 Add lzma loader 2021-12-28 16:08:06 +01:00
Kim Woelders cbe7408bd8 test: Add a couple of ico depth test images 2021-12-26 12:22:20 +01:00
Kim Woelders 8370777a31 Make initial context static
Avoids having to check on every API function call.
2021-12-08 19:12:29 +01:00
Kim Woelders dbdea2a4a6 test: Add context test 2021-12-06 14:30:30 +01:00
Kim Woelders 9b29249619 test: Add some scaling/rotation tests 2021-12-04 06:55:21 +01:00
Kim Woelders 074c408608 test_save: Check images with alpha too 2021-12-04 06:55:21 +01:00
Kim Woelders e0e4f883e9 test_grab: Add scale-down tests 2021-11-25 15:46:23 +01:00
Kim Woelders 00d050901d test_grab: Cleanups, cosmetics 2021-11-25 15:46:23 +01:00
Kim Woelders 6e27c1e2c3 Fix y-upscaling in imlib_create_scaled_image_from_drawable() 2021-11-25 15:45:56 +01:00
Kim Woelders 008e4e9fd4 test: Add X11 drawable grabbing test 2021-11-23 20:33:25 +01:00
Kim Woelders 0ef105d43c test: test_load improvements 2021-11-05 17:22:01 +01:00
Kim Woelders 81b4e7b56b test: Add test_load_2
Checking signature (CRC) of loaded images.
2021-10-18 19:33:25 +02:00
Kim Woelders 579b1b3366 test: Add icon-64.pbm 2021-10-16 20:46:49 +02:00
Kim Woelders 4e15a7974c Fix build (Imlib2.h is now built) 2021-10-08 19:43:14 +02:00
Kim Woelders e99c7a3bf0 Test: Fix dist
Also do proper clean.
2021-09-25 11:06:02 +02:00
Kim Woelders 8ac8041adf Test: Add some minimal regression testing 2021-09-19 13:12:20 +02:00
Sytse Wielinga 20d8416051 A lot of moving around in imlib2{,loaders} caused lots of unignored files
SVN revision: 13131
2005-01-29 18:26:35 +00:00
Michael Jennings ac4750e3d9 Ssssh!
SVN revision: 12740
2005-01-04 14:47:04 +00:00
Carsten Haitzler 31660022d0 remooov!
SVN revision: 12112
2004-11-01 09:34:29 +00:00
Carsten Haitzler 66934e2c8c sorry - mej - you seem to have broken the build on other systems and
imlib2-config wasnt being installed - also it was deciding it had to
cross-compile and build i686-gnu-linux-imlib2-config etc. files... had to
move autogen.sh to this... :(


SVN revision: 10710
2004-07-06 07:03:51 +00:00
Carsten Haitzler fdc031b0c0 --without-x works again
SVN revision: 10123
2004-05-08 14:30:32 +00:00