Commit Graph

1874 Commits

Author SHA1 Message Date
Kim Woelders 3106fbd0d2 x11_grab: Remove some obsolete code
Should have been removed as part of 8af7975804.
2023-09-30 21:41:27 +02:00
Kim Woelders 45d58cc268 test_save: Update crcs for jxl saver (libjxl 0.8.0)
Also add a couple of missing ifdefs.
2023-09-25 05:21:26 +02:00
Kim Woelders 9198db2536 v1.12.1 2023-09-21 16:45:53 +02:00
Kim Woelders 1bd9920c07 x11_grab: Use correct depth when grabbing
Use queried drawable depth, not the context one.

Fixes grabbing of bitmaps (now using intended colormap) in the
usual 24 bit depth case.
May fix other issues as well(?).

Broken by 3ab9498777 (in v1.11.0).
2023-09-21 09:15:00 +02:00
Kim Woelders 3fd4347cfa imlib2_grab, imlib2_view: Unset context colormap
Should normally not be set when grabbing.
2023-09-21 06:45:42 +02:00
Kim Woelders be9ac449e7 loaders: Fix CPPFLAGS order
Patch by Omar Polo:

while upgrading the OpenBSD package I've come across a weird issue.
Due to the order of the flags, the heif module was loading the system'
version of Imlib2_loader.h (in /usr/local/include) instead of the one
from the tarball.  This caused failure since the previous version
(1.11.0) didn't had IMLIB_LOADER_INEX.
2023-09-04 17:01:33 +02:00
Kim Woelders f16bb23864 RAW loader: Don't unload loader
Running with valgrind or asan seems to show that unloading/reloading the
loader causes memory leaks. Not dlcose()'ing the module avoids this.
2023-09-03 20:16:12 +02:00
Kim Woelders 570c50d75a test_scale: MMX scaling is disabled 2023-09-03 17:11:21 +02:00
Kim Woelders 57403f2ec3 test_save: Fix for jxl loader on ix86
libjxl apparently behaves differently for ix86 and x86_64.
2023-09-03 17:11:21 +02:00
Kim Woelders 03cbf75a96 test_load_2: Add forgotten xeyes.png 2023-09-03 17:11:21 +02:00
Kim Woelders 1e5040e8e7 loaders: Fix build with -m32 --enable-debug 2023-09-03 17:11:21 +02:00
Kim Woelders 687e13b290 loading: Call module exit function also when not dlclosing module on unload
The proper thing to do.
Does not affect any of the current loaders.
2023-09-03 16:34:50 +02:00
Kim Woelders 66f48df4cf scaling: MMX asm scaling causes segv, disable for now
Broken in v1.12.0 by ee61df6877 (pointers
to indices), __imlib_Scale_mmx_AARGBA() needs to be fixed.
2023-09-03 10:32:10 +02:00
Kim Woelders 74dae151cd Fix some clang complaints 2023-08-24 19:07:43 +02:00
Kim Woelders 5300f19575 v1.12.0 2023-08-17 16:41:56 +02:00
Chema Gonzalez 0b08655e40 Y4M loader: add support for images with unexpected aspects
Tested:

Added a new test case with an unknown aspect (A368:375).
2023-08-16 12:12:53 +02:00
Kim Woelders a22b9b88c0 test_scale: Exercise non-AA path too 2023-08-09 20:34:30 +02:00
Kim Woelders 4f17d66965 test_scale: Update for new scaling (re-applied) 2023-08-09 17:58:20 +02:00
Kim Woelders d6b86f307e scaling: Correct scaling up - take 2
When scaling up (with AA) it worked sort of like there was a 1 pixel
border right and bottom.
2023-08-09 17:58:20 +02:00
Kim Woelders 4d5b1413b1 scaling: Improve non-AA scale-up case
Make source sampling more evenly distributed.
Most visible for small source dimensions.
2023-08-09 17:58:05 +02:00
Kim Woelders 29397453e4 scaling: Various trivial changes 2023-08-09 17:58:05 +02:00
Chema Gonzalez a88b95c289 Y4M loader: fix support for 420 colorspaces
Includes:
* add support for 420mpeg2 (ffmpeg-only)
* add example for 420mpeg2
* add examples for 420, 420paldv
* fix 420jpeg example
2023-08-03 12:34:30 +02:00
Chema Gonzalez 63106616b9 test_load2: make error messages more descriptive
Tested:

Before:
```
$ IMLIB2_LOADER_PATH=../src/modules/loaders/.libs ./test_load_2
...
[ RUN      ] LOAD2.load_1
test_load_2.cpp:121: Failure
Expected equality of these values:
  crc
    Which is: 671661664
  tii[i].crc
    Which is: 4016720483
test_load_2.cpp:128: Failure
Expected equality of these values:
  crc
    Which is: 671661664
  tii[i].crc
    Which is: 4016720483
test_load_2.cpp:135: Failure
Expected equality of these values:
  crc
    Which is: 671661664
  tii[i].crc
    Which is: 4016720483
[  FAILED  ] LOAD2.load_1 (70 ms)
...
```

After:
```
$ IMLIB2_LOADER_PATH=../src/modules/loaders/.libs ./test_load_2
...
test_load_2.cpp:122: Failure
Expected equality of these values:
  crc
    Which is: 671661664
  tii[i].crc
    Which is: 4016720483
wrong crc file: ./images/icon-64.xpm expected: 4016720483 actual: 671661664
test_load_2.cpp:131: Failure
Expected equality of these values:
  crc
    Which is: 671661664
  tii[i]. crc
    Which is: 4016720483
wrong crc file: ./images/icon-64.xpm expected: 4016720483 actual: 671661664
test_load_2.cpp:142: Failure
Expected equality of these values:
  crc
    Which is: 671661664
  tii[i]. crc
    Which is: 4016720483
wrong crc file: ./images/icon-64.xpm expected: 4016720483 actual: 671661664
[  FAILED  ] LOAD2.load_1 (69 ms)
...
```
2023-08-03 12:34:30 +02:00
Kim Woelders 310e9e162d Revert "test_scale: Update for new scaling"
This reverts commit 41be1c88f8.
2023-07-30 17:33:44 +02:00
Kim Woelders fae1423025 Revert "scaling: Correct scaling up"
Correction is not correct :(

This reverts commit 58f2fcb4c7.
2023-07-30 17:33:14 +02:00
Kim Woelders 9d5f704036 image cache: Rework cleanup
Eliminates a nested loop in __imlib_CurrentCacheSize().

Only add to cached size if image data are loaded.
2023-07-19 21:44:04 +02:00
Kim Woelders 26dd602fa0 image cache: Drop redundant cleanup
Already done in __imlib_CurrentCacheSize().
2023-07-19 21:44:04 +02:00
Kim Woelders 2474de6f94 image cache: Avoid negative refcounts
Presumably unintended, obscures things.
2023-07-19 21:44:04 +02:00
Kim Woelders 173edae4bf image: Fix preservation of alpha chanel flag in imlib_clone_image()
#17:

As per subject, the imlib_clone_image() function no longer preserves
the alpha channel value since imlib2 1.10.0.

This bug report was initially filed by Niko Tyni in Debian's bug tracker.
If you follow the subsequent link you will also find a test program that
demonstrates the regression.

https://bugs.debian.org/1041406

This upstream change is most likely the root cause of the problem

b39d33c800

It looks like an oversight where other functions were adapted
to the new alpha channel implementation, but imlib_clone_image() remains
unchanged and only copies the flags and not the new alpha byte.
2023-07-19 18:50:11 +02:00
NRK 50295779a1 introduce imlib_image_decache_file()
Fixes: #16
2023-07-07 18:49:08 +02:00
Kim Woelders a1ea31e070 image: Use sub-second time info when available 2023-07-07 13:14:35 +02:00
NRK cf5b462d92 file: Remove unused functions some more 2023-07-05 18:55:05 +02:00
Kim Woelders 70bd7e3488 TIFF loader: Slightly more strict signature check
Avoid starting libtiff on various raw image types.
2023-07-02 21:33:39 +02:00
Kim Woelders 59ab21a580 Add new raw loader
#10
2023-07-02 21:33:39 +02:00
Kim Woelders 1afc1302c9 test_load: Minor fix in debug message 2023-07-02 21:33:20 +02:00
Kim Woelders efd0bccb92 test: Bypass wrappers when running tests 2023-07-02 21:24:40 +02:00
Kim Woelders 31b50aee15 image: Fix potentially using incorrect file size - fixup
Close opened file if we don't like it (zero size, directory).
2023-07-02 21:24:40 +02:00
Kim Woelders 595d0a322d file: Remove a couple of unused functions
__imlib_IsRealFile() and __imlib_FileExists() are not used.
__imlib_FileStat() can now be private.
2023-06-26 08:13:25 +02:00
Kim Woelders aec432b3ce image: Fix potentially using incorrect file size
During load from file we would do stat(file), then fopen(file),
and assume the stat'ed size corresponds to the fopen'ed file.
However, the file may be changed between stat() and fopen(), which may
cause trouble.
This should now be fixed by always using fstat() on the opened file
descriptor.
2023-06-26 08:13:25 +02:00
Kim Woelders f1fcc4bfed image: Fix missing munmap() when using imlib_load_image_fd() 2023-06-25 12:01:47 +02:00
Kim Woelders 41be1c88f8 test_scale: Update for new scaling 2023-06-24 17:32:39 +02:00
Kim Woelders 58f2fcb4c7 scaling: Correct scaling up
When scaling up it worked like there was a 1 pixel border right and
bottom.

This change may affect applications that rely on the old behavior.
Setting the environment variable IMLIB2_LEGACY_SCALING to any value will
make imlib2 use the old algorithm.

When using e16 with the new (default) algorithm a few themes have
incorrectly rendered elements (unintended window border fading, opaque
pager highligt frame, more?).

Hopefully this change should go mostly unnoticed but if it turns out it
causes grief the default will probably have to be changed back.
2023-06-24 17:32:05 +02:00
Kim Woelders a72fe3796b scaling: Minor refactoring 2023-06-24 17:01:15 +02:00
Kim Woelders 166de6a93e scaling: Cosmetics 2023-06-24 17:00:21 +02:00
Kim Woelders ee61df6877 scaling: Change ypoints[] from pointers to indices
Now the calculation of ypoints[] and xpoints[] can be done by the same
function and we can avoid some essentially duplicated code.
May be slightly less optimal although I doubt it makes any significant
difference.
2023-06-24 16:58:42 +02:00
Kim Woelders eafaa11ff3 scaling: Simplify scaling points calculation (eliminate j) 2023-06-24 16:58:42 +02:00
Kim Woelders a75fc4c5c8 scaling: Cosmetics (comments) 2023-06-24 16:57:56 +02:00
Kim Woelders 61a180f3b0 scaling: Move scaling function call sequence into common __imlib_Scale() 2023-06-24 09:42:58 +02:00
Kim Woelders 5c0c98428d scaling: Correct scaleinfo array length
The +1 length may have been used in the old OLD_SCALE_DOWN case.
2023-06-24 09:42:58 +02:00
Kim Woelders 41a6517319 scaling: Unifdef OLD_SCALE_DOWN
And adjust some comments.
2023-06-24 09:42:58 +02:00