Webp decode can only shrink-on-load to int boundaries. This means that frames
in an animation which only update part of the canvas can get displaced by
up to 0.5 pixels, causing juddering.
see https://github.com/libvips/libvips/issues/2379
The filemode ifdefs had grown to 30 lines of code duplicated in four
source files. Move to a single copy in a private header (not part of the
public API).
* Cleanup unused defines
* win32: do not inherit open file handles in child processes
`O_NOINHERIT` and the `N` flag of `fopen` is available in all
supported Windows versions.
* unix: ensure any open file handles are closed on exec
`O_CLOEXEC` is available since Linux 2.6.23 and is ignored on
earlier versions. `e` flag of `fopen` is available since glibc 2.7.
* allow utf-8 header for svg detection
We were checking that the first 24 chars of an SVG were plain ASCII,
but that's not always the case, for example:
<svg id="レイヤー_1のコピー"
data-name="レイヤー 1のコピー"
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 100 100">
</svg>
We now test for the string "<svg" being in the first 1000 bytes, and
everything up to that being valid utf-8.
See https://github.com/libvips/libvips/issues/2438
* raise priority of webpload
it was very low priority before, for some reason
switch GIF save to frame at a time
And make a new colormap if the frame average changes. This keeps memory use low, even for very large GIFs, though is somewhat slower.
See https://github.com/libvips/libvips/pull/2445
* Add jpeg restart_interval option.
This allows saving a jpeg with MCU restarts.
* Fix code style. Add description of restart_interval.
* Add a basic test based on output length.
* Update main change log.
We used to assume (in several places) that any source with a filename was
seekable. This patch adds a is_file test, and makes all the loaders use it.
see https://github.com/libvips/libvips/issues/2467
We were looping over pages, cropping each one out, and saving.
Now there's a single loop for thw whole of the image, so things like
percent reporting work in the obvious way.
See https://github.com/libvips/libvips/issues/2450
remove shutdown from atexit
Because atexit() can be called at almost any point during process termination,
including after worker threads have been force-quit, we can't use it for
cleanup.
New policy: use vips_shutdown() explicitly if you need to clean up,
though it's optional. Only use atexit() for leak checking.
* fic gtk-doc typenames in cgif
* fix flatten clipping
flatten could produce out of range values if max_alpha was less than
the limit of the numeric range of the format
https://github.com/libvips/libvips/issues/2431
* Ensure UBSan exits with a non-zero code on error
* Avoid misaligned member access in mosaic_fuzzer
* Add missing VIPS_CLIP in scRGB2sRGB/scRGB2BW
* Fix UBSan error in flatten
By using saturated casts for the int types (copied from vips_cast).
* CI: ensure fuzzer log is printed on error
* Avoid UB in heifload
* Revert flatten change
I could no longer reproduce this with clang 12 locally.
* Indentation fixes [skip ci]
Provides control over the maximum number of colours in the output
image palette, making the API more closely match that of pngsave.
Lowering the bitdepth to 7 (from the default value of 8), which
halves the maximum number of colours from 255 to 127, typically
reduces encoding time by ~20%.