Commit Graph

5705 Commits

Author SHA1 Message Date
John Cupitt 55b857d446 revise cast asserts
since we allow casting between formats ofthe same size with shift enabled

fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=45016&q=libvips&can=2
2022-04-03 15:32:25 +01:00
Lovell Fuller 9228e50f46
vipsload: ensure resolution is positive (#2742) 2022-04-03 11:00:44 +01:00
John Cupitt dc07b00059 set vips-sequential as a simple int
to avoid trouble with bindings which don't implement get for an empty
VipsArea
2022-03-31 17:05:02 +01:00
John Cupitt 39e75e07a2 deprecate "properties", register ".szi" as a suff 2022-03-29 17:50:48 +01:00
John Cupitt d58b3410c4 tiny perf improvement 2022-03-28 12:35:25 +01:00
John Cupitt a77a1071a2 fix a crash with empty image arrays in bandjoin
see https://github.com/libvips/pyvips/pull/310
2022-03-24 22:38:03 +00:00
John Cupitt 62fee01f3a add notes on cast and copy to arithmetic 2022-03-23 10:24:24 +00:00
John Cupitt 9f351c9c58 tiny doc polish 2022-03-22 15:38:24 +00:00
John Cupitt 75e6906f52 improve morph docs 2022-03-22 15:36:11 +00:00
John Cupitt 9713a71bf0 block resolutions < 0
since they can trigger a sanity failure in the test suite
2022-03-22 15:09:13 +00:00
John Cupitt 1b97b52318 clarify draw docs
see https://github.com/libvips/libvips/discussions/2733
2022-03-22 10:03:36 +00:00
John Cupitt a77519f7c3 try to improve docs
see https://github.com/libvips/libvips/discussions/2733#discussioncomment-2412590
2022-03-22 09:10:34 +00:00
John Cupitt eaf34b8f13 remove openjpeg bpp handling
it's deprecated
2022-03-17 15:02:29 +00:00
John Cupitt 168d7652c2 Merge branch '8.12' 2022-03-11 16:25:11 +00:00
John Cupitt f0eb493643 fix thumbnail with cmyk output
see https://github.com/libvips/php-vips/issues/138

thanks AdamGaskins
2022-03-11 16:21:12 +00:00
Essem d4eb2e82d2
cgifsave: Make loop counts more accurate (#2709)
* cgifsave: Added "noloop" option

* cgifsave: Change loop count logic

* make sure nsgifload returns the correct loop count

* Revert "make sure nsgifload returns the correct loop count"

This reverts commit 77550f097940944492d4178a783fc4e73c7a769f.

* Add fallback
2022-03-10 12:30:57 +00:00
Michael Drake 292ee9a47e
libnsgif: Update to latest upstream. (#2712) 2022-03-09 10:13:48 +00:00
John Cupitt 2fdab9ba70 check page size from pdfium
PDFium allows page width and height to be less than 1, which will cause
libvips severe indegestion.
2022-03-08 10:21:08 +00:00
John Cupitt ede67090cb revise resample docs
see https://github.com/libvips/libvips/discussions/2711
2022-03-06 11:42:27 +00:00
Michael Drake 5f7c12e474
libnsgif: Update to latest upstream. (#2706) 2022-03-04 08:05:36 +00:00
John Cupitt c0de1b6169 fix dispose order in gifsave
Shut down cgif before we shut down the target it is writing to so that
flush in cgif has somewhere to flusgh to.

See https://github.com/libvips/libvips/discussions/2707
2022-03-03 22:41:11 +00:00
Kleis Auke Wolthuizen 330ebf3cd7
Mosaicing fixes and improvements (#2705)
* Fix segv in `vips_mosaic1`

* Fix ref handling in `rotjoin_search`

* Pass `oarea` to `vips_affine` as `VipsArrayInt` instead

* Flip X/Y positions in `vips__coeff`

* Fix `-Wunused-but-set-variable` warning

* Deprecate unused mosaicing arguments

* Remove a couple of stray header decls
2022-03-03 20:10:20 +00:00
Kleis Auke Wolthuizen a0f9cd95e0
Ensure compatibility with nip2 (#2704)
nip2 uses the `VIPS_EXEEXT` definition.
2022-03-03 18:51:33 +00:00
Michael Drake ac35124f59
nsgifload: Fix gif decoding issue. (#2702)
The nsgif_data_scan() call returns an error code that says
if anything was wrong with the source data.

It is not unusual for there to be bad stuff in a GIF, so we
only need to worry if we failed to find any frames.
2022-03-03 18:49:31 +00:00
John Cupitt f65b615a17 minor nsgifload revisions
- add note to changelog
- remove dead code
- improve debug output
- track current page number

see https://github.com/libvips/libvips/pull/2699
2022-03-03 11:49:13 +00:00
John Cupitt eb577606a0 revise change detection again
to fix debug output
2022-03-03 11:48:49 +00:00
Michael Drake 8e9fe72dea
Update libnsgif (#2699)
* libnsgif: Rename upstream README with markdown extension.

* libnsgif: Drop default frame delay patch

* libnsgif: Remove unused utils / log.h header.

* libnsgif: Rename files to match upstream.

* libnsgif: Extend update script to update local README and test/

* libnsgif: Run update script.

* libnsgif: Update buildsystem for renamed files

* nsgifload: Switch to new library header.

* nsgifload: Remove optional and unused bitmap callbacks.

* nsgifload: Update to use new libnsgif API.
2022-03-03 10:02:36 +00:00
John Cupitt 716fbf75b1 raise GIF save frame size limit 2022-03-02 18:06:44 +00:00
John Cupitt 669ea43138 improve the GIF save change detector
Instead if just summing PELs, scale RGBA differently. This lets us
detect changes like [255, 0, 0] to [9, 255, 0]
2022-03-02 18:03:36 +00:00
John Cupitt de2adb99a2 better frame write loop for gif save 2022-02-28 17:20:42 +00:00
John Cupitt 3b6072437d add new param to gifsave docs
also note in changelog and revise layout for 80 columns

see https://github.com/libvips/libvips/pull/2628
2022-02-28 16:38:02 +00:00
Daniel Löbl b0f993eec8
cgifsave: avoid size issue (#2628)
* cgifsave: avoid size issue

avoid size issue by restoring the original transparency setting after quantization/dithering

* switch to per-frame alpha channel

* add option for lossy transparency

* switch lossy transparency off by default

* switch to g_malloc instead of g_malloc0

no need to 0 initialize at this point

* adapt to libvips coding conventions

* cgifsave: avoid size issue

avoid size issue by restoring the original transparency setting after quantization/dithering

* switch to per-frame alpha channel

* add option for lossy transparency

* switch lossy transparency off by default

* switch to g_malloc instead of g_malloc0

no need to 0 initialize at this point

* adapt to libvips coding conventions

* switch to official Homebrew sources for installing cgif

* bump required cgif version to v0.2.0
2022-02-28 16:19:13 +00:00
John Cupitt 3073ee90b7
Improve edge handling for mapim (#2681)
* almost there

* smol changes

* getting close now

segv on the test suite, annoyingly

* argh still not quite thert

* phew
2022-02-28 09:12:09 +00:00
John Cupitt 9d841e848f more init check to libvips base class
helps introspection run correctly if there's no vips_init()
2022-02-27 18:48:37 +00:00
Kleis Auke Wolthuizen f11b58ff6c
Remove `VIPS_EXEEXT` and `VIPS_SONAME` definitions (#2694)
And the corresponding `soname.h` header.
2022-02-27 15:27:37 +00:00
Kleis Auke Wolthuizen 0337c09700
Cleanup gettext handling (#2695)
Use GLib's i18n support instead of copying and pasting that
logic into its own header. This deprecates the vips/intl.h
header in favour of glib/gi18n.h.
2022-02-27 15:27:28 +00:00
Kleis Auke Wolthuizen 517089fb4b
Meson: don't install deprecated headers when `-Ddeprecated=false` (#2693) 2022-02-27 13:44:09 +00:00
Kleis Auke Wolthuizen 65fbcd351b
Add missing funcs to public C API (#2692) 2022-02-27 13:42:17 +00:00
Kleis Auke Wolthuizen 50a74ceeec
Mark some functions and variables as static (#2691)
These are only used in the same file, and not exported.
2022-02-27 13:41:39 +00:00
Lovell Fuller 6639b90f22
window: delay setting ref count (#2690)
fixes an assert fail in window_free
2022-02-27 09:50:04 +00:00
Kleis Auke Wolthuizen a8b48e1442
Add missing annotations to #endif directives (#2678) 2022-02-23 11:55:40 +00:00
John Cupitt 5ff96da873 add note on heifload unlimited to changelog 2022-02-23 10:35:46 +00:00
Lovell Fuller 4ca4b07654
heifload: add unlimited option, default to false (#2677) 2022-02-23 10:34:07 +00:00
Kleis Auke Wolthuizen 1e4cd2d5c2
Fix building with -Dmodules=disabled (#2676)
* Fix building with -Dmodules=disabled

* Reformat line [skip ci]
2022-02-23 10:32:02 +00:00
Kleis Auke Wolthuizen d80185060d
Various improvements to the build systems (#2675)
* Meson: remove space before colon

Since key-value pairs in Python are usually delimited as
colon+space instead of space+colon+space.

* Meson: disable modules by default when building static libraries

Corresponds to autotools. See: #2323.

* Meson: make modules a feature option

Corresponds to autotools, where modules are built
automatically if enabled and supported.

* Meson: specify minimum required GLib version

* Meson: fix indentation

* Remove unused function checks

* Simplify GLib configure checks

* Meson: ensure modules doesn't include enumtypes sources

Since that would cause duplicate symbols.

(`soname_header` can also be safely removed here,
since that is already included in `libvips_headers_dep`)
2022-02-22 14:33:42 +00:00
John Cupitt c5f2fea8bf fix a gcc warning with clang pragmas 2022-02-22 10:06:43 +00:00
Michael Drake b05515b0c5
Update libnsgif from upstream (#2674)
* libnsgif: Remove patch artifact.

* libnsgif: Update from upstream.
2022-02-21 20:07:20 +00:00
John Cupitt 49cae56e1e stray "im_" prefix 2022-02-20 17:07:29 +00:00
Kleis Auke Wolthuizen 3da7caee6c
LSan improvements and fixes (#2672)
* LSan: remove GLib suppression

* LSan: disable the fast unwinder to get full stacktraces

* Move ASan/UBSan fuzzer options to CI configuration

* LSan: remove EOLed python2.7 suppression

* LSan: remove libstdc++ suppression

* LSan: add libx265 to suppression file

* Try to reproduce small memleak

* Try a possible patch

* Skip test if `im_benchmark` is not available

* CI: upgrade Clang version to 13

* CI: correct job names

* Meson: increase the timeout for tests

* README.md: correct Meson invocation
2022-02-19 15:13:42 +00:00
John Cupitt e985e23c09
add HDR support to heif load/save (#2596)
* heifload done, doing save

* finish save, add tests, docs
2022-02-18 11:16:15 +00:00
John Cupitt dc069f8892 ooop typo 2022-02-18 09:53:40 +00:00
John Cupitt 01a9947006 remove atexit use
too unreliable to be useful
2022-02-17 14:30:02 +00:00
John Cupitt f6dafd6fc6 update changelog for intospection fixes
and default on, since there are now so few warnings
2022-02-15 10:59:11 +00:00
Corentin Noël 69bf2be12b
Enhance the introspection support by fixing annotations (#2657)
Also refine the .metadata file
2022-02-15 10:54:40 +00:00
John Cupitt 82a8df2a1f fix some more small introspection warnings 2022-02-15 10:10:21 +00:00
John Cupitt 362adae8c6
Revert "Enhance the introspection support by fixing annotations (#2655)" (#2656)
This reverts commit 47796dcda0.
2022-02-15 10:08:07 +00:00
Corentin Noël 47796dcda0
Enhance the introspection support by fixing annotations (#2655)
* Ensure that double asterisk characters are only used for gtk-doc comments

This triggers warnings when parsing the files with the introspection scanner
and gtk-doc

* Enhance the introspection support by fixing annotations

Also refine the .metadata file

Co-authored-by: John Cupitt <jcupitt@gmail.com>
2022-02-15 09:54:32 +00:00
John Cupitt 257d84108e fix some more introspection warnings 2022-02-15 09:48:01 +00:00
Corentin Noël 542dd06999
Refine header inclusion to allow better introspection generation (#2654)
The headers need to be self-contained for the introspection parser
to work correctly. The entry for external users remains vips/vips.h
2022-02-15 05:02:07 +00:00
John Cupitt 1862e7209e add spngsave to meson build 2022-02-11 16:43:02 +00:00
John Cupitt 896cad6a7a
Add spngsave (#2536)
* quick hack

won't even compile

* works!

at a basic level, anyway

* start wiring up metadata

* metadata done

* add spng interlaced save

* start adding index support

* fix palette save

* Update libvips/foreign/spngsave.c

Co-authored-by: Kleis Auke Wolthuizen <github@kleisauke.nl>

* start adding low bit depth write

* add a warning for low bitdepth write

* small fixes

* add 1/2/4 bit write

adapted from the vips2tiff bit packer

* small polish

* note spngsave in changelog

* Update libvips/foreign/spngsave.c

Co-authored-by: Kleis Auke Wolthuizen <github@kleisauke.nl>

* Update libvips/foreign/spngsave.c

Co-authored-by: Kleis Auke Wolthuizen <github@kleisauke.nl>

* revise 8 and 16-bit PNG write rules

* cleanup

* remove unnecessary palette filter optimisation

since libspng already does this

* add xres/yres rounding

thanks klies

he commit message for your changes. Lines starting

* look for spng.pc and libspng.pc

It can be called either, frustratingly.

* fix PACKAGES_USED for spng .pc changes

Co-authored-by: Kleis Auke Wolthuizen <github@kleisauke.nl>
2022-02-11 16:30:23 +00:00
Corentin Noël 02901436d4
Add meson build system (#2637)
Allows to use the Meson build system to build the project.
2022-02-08 15:19:36 +00:00
John Cupitt 0d8056b8c5 fix a few small compiler warnings 2022-02-03 14:28:22 +00:00
John Cupitt 8c668303f8 improve the pixel rng
see https://github.com/libvips/libvips/issues/2642
2022-02-02 18:15:26 +00:00
John Cupitt d9c00eb5ca add password fielf to pdfiumload
and docs
2022-01-28 13:32:13 +00:00
John Cupitt cb78b1b9fb add "password" option to pdfload
loads at least AES128-encrypted PDFs

pdfiumload needs a similar feature

see https://github.com/libvips/libvips/issues/2635
2022-01-28 13:25:46 +00:00
John Cupitt 0a7e96a4e2 Merge branch '8.12' 2022-01-28 08:51:27 +00:00
John Cupitt 68a8bf42a7 better arg checking for hist_find_ndim
we were not checking the number of input bands

move checks to _build

thanks travisbell

see https://github.com/libvips/libvips/issues/2634
2022-01-28 08:47:30 +00:00
John Cupitt 646f2d7fd7 Fix read from pipe with variable chunk sizes
free the header cache only once it's exhausted
2022-01-24 12:12:03 +00:00
John Cupitt 260b2ddf92
Fix read from pipe with variable chunk sizes
free the header cache only once it's exhausted
2022-01-24 11:27:22 +00:00
John Cupitt cfa7f03278 Merge branch '8.12' 2022-01-18 18:23:20 +00:00
John Cupitt 774c969d43 fix GIF save change detector
We were only using the top 25% of the frame for GIF pallette change
detection.

Thanks TheEssem

See: https://github.com/libvips/libvips/issues/2622
2022-01-18 18:15:38 +00:00
John Cupitt f01c9fcd91 add missing header to _sources
thanks Kleis
2022-01-18 16:15:26 +00:00
John Cupitt 1496984a7a add jp2k load left-justification
We were loading 12-bit images as 0-4095 pixels, which then looked very
dark as RGB16. This patch left-justifies bits to fill 0-55, 0-65535 etc.
as required.
2022-01-17 14:18:59 +00:00
John Cupitt ce54b4e5ad Merge branch '8.12' 2022-01-13 11:47:53 +00:00
John Cupitt 6b475c92a2 raise linpng size limit
By default libpng is limited to 1m pixels per axis. Raise this to
VIPS_MAX_COORD, ie. 10m pixels.
2022-01-13 11:44:28 +00:00
John Cupitt 56a7916e80 remove stray error messages 2022-01-09 12:20:25 +00:00
John Cupitt c278f9019d Merge branch '8.12' 2022-01-01 00:29:26 +00:00
John Cupitt f75b3c1ee9 adjust GIF alpha threshold
see https://github.com/libvips/libvips/discussions/2604
2021-12-31 20:20:56 +00:00
John Cupitt eb906f182d Merge branch '8.12' 2021-12-22 10:26:57 +00:00
John Cupitt d3f77e4433 add a sniffer for TTF
since TTF files can be caught by the almost unfixably overgenerous TGA sniffer

see https://github.com/libvips/php-vips/issues/127
2021-12-22 10:25:52 +00:00
Joel Larsson 93ff76ce53 Fix documentation typo (#2591)
A small typo fix on the documenation of `vips_percent`
2021-12-21 14:54:02 +00:00
Joel Larsson 1ed0e177bb
Fix documentation typo (#2591)
A small typo fix on the documenation of `vips_percent`
2021-12-21 14:53:14 +00:00
Aaron b6ca9eeff3 dzsave.c: Remove trailing comma from IIIFv3 folder names (#2590)
Fixes #2589.

Signed-off-by: Aaron <admin@datahoarder.dev>
2021-12-21 09:46:04 +00:00
Aaron d98a003008
dzsave.c: Remove trailing comma from IIIFv3 folder names (#2590)
Fixes #2589.

Signed-off-by: Aaron <admin@datahoarder.dev>
2021-12-21 09:43:48 +00:00
John Cupitt 1502b4af0c oop, dropped patch 2021-12-18 18:24:13 +00:00
John Cupitt 03a073b68d set default GIF frame delay to 100ms
was 1000ms, see https://github.com/libvips/libvips/issues/2582
2021-12-18 18:20:18 +00:00
John Cupitt 9420911ba8 change default GIF frame delay from 1s to 0.1s
This is the delay if the GCB is missing.

See https://github.com/libvips/libvips/issues/2582
2021-12-18 18:08:30 +00:00
John Cupitt 0a824517fa Merge branch '8.12' 2021-12-16 10:58:29 +00:00
John Cupitt 65d84d1cbe fix a crash with 0 length vectors 2021-12-16 10:45:10 +00:00
John Cupitt 753c52cdc4 Merge branch '8.12' 2021-12-12 10:15:04 +00:00
John Cupitt 1fe283cc85 remove GIF frame size limit
We limited GIFs to 16k on an axis, but there are a few larger than
this. Check for 64k instead (the GIF format limit).
2021-12-12 10:12:00 +00:00
John Cupitt 561b670ea2 better dbg messages from tiffsave 2021-12-09 13:18:46 +00:00
John Cupitt 47be1fcc6f Merge branch '8.12' 2021-12-09 13:01:51 +00:00
John Cupitt 6d23a3615e add a fallback path for gif save if no cgif
Via imagemagick. See https://github.com/libvips/libvips/issues/2574
2021-12-09 13:00:58 +00:00
John Cupitt 5b089951ac Merge branch '8.12' 2021-12-06 14:04:49 +00:00
John Cupitt cd80b5ae94 note win fd change in changelog 2021-12-06 13:58:46 +00:00
Lovell Fuller b28ee777ab
Windows: don't set create time for invalid/stream fd (#2571) 2021-12-06 13:52:02 +00:00
John Cupitt ba5afffd68 Merge branch '8.12' 2021-11-26 11:12:47 +00:00
John Cupitt e0bb8e5d58 make exif resunit optional and default to inch
Some images don't set the exif resolution unit. We were ignoring exif
resolution in this case, but that's not correct, it's supposed to
default to inch.

See https://web.archive.org/web/20190624045241if_/http://www.cipa.jp:80/std/documents/e/DC-008-Translation-2019-E.pdf for the full spec.
2021-11-26 11:10:29 +00:00
John Cupitt 728f2e2905 Merge branch '8.12' 2021-11-21 15:13:17 +00:00
John Cupitt edf63dfeeb fix insert
We were not detecting the shortcut cases for insert correctly, thanks
chreru.

See https://github.com/libvips/libvips/issues/2548
2021-11-21 14:50:55 +00:00
Sergey Alexandrovich d71a3c2fc1
Quantizr support (#2542) 2021-11-21 10:11:28 +00:00
Michael Drake 8c9d899acd
libnsgif: Update to the latest upstream master (#2547)
* libnsgif: Delete patch for read only source data.

The source data is now read only in upstream libnsgif and the code
has changed quite a bit so this does not apply.

* libnsgif: Update to latest upstream master.

* libnsgif: Only one insufficient data return code now.

There is only one code now, for "I need more data".

* libnsgif: Update for renamed structure member.
2021-11-21 10:06:37 +00:00
John Cupitt cb58d7d960 _source loaders should all be nocache
When we image_new_from_source, the source object has some of the loader
state: it tracks the current read position of the load library. This
means that we mustn't keep source loaders in the operation cache, since
a second call could give a different result because the source object
read position might have changed.

Also: add a rewind to get_flags_source in spngload, and jp2k needs to
tag its load region as having no thread ownership or you'll get assert
fails in the test suite with debug enabled.
2021-11-19 13:55:49 +00:00
John Cupitt 80f2581e0c expand the docs for vips_shutdown()
see https://github.com/libvips/libvips/discussions/2540
2021-11-16 10:56:43 +00:00
Remi Collet 407bd1391d
allow libjxl 0.5 (#2539) 2021-11-16 09:51:19 +00:00
John Cupitt 57a0bd82f9 small fixes
update func list in docs
add missing C decls for hyperbolic trig funcs
2021-11-15 11:17:36 +00:00
John Cupitt fef024061f layout fixes for tga sniff 2021-11-14 04:09:23 +00:00
Moggers b3ff4d9ed6
Implement Header Sniffing For Magickload Tga (#2533)
Add TGA sniffing
2021-11-14 04:04:32 +00:00
John Cupitt 01e3f1fc33
set libvips orientation on magickload (#2535)
Pick up the imagemagick / graphicsmagick orientation field for libvips.

Tested with graphicsmagick, magick6 and magick7.

see https://github.com/libvips/libvips/issues/2528
2021-11-13 14:38:30 +00:00
John Cupitt ad295b5d41 add changelog notes 2021-11-13 14:36:38 +00:00
John Cupitt 8195b67d83 better exif string value change detection
see https://github.com/libvips/libvips/pull/2518
2021-11-09 19:28:55 +00:00
John Cupitt 296fd99925 clarify doc comments for hist_find_
Say when u8 or u16 are picked.

See https://github.com/libvips/libvips/issues/2519
2021-11-07 11:14:52 +00:00
John Cupitt 6f081de0a0 add minimise to insert
This patch makes "insert" issue minimise signals for inputs in sequential
mode. This can drop memory use in some programs, for example:

```python

import sys
import random
import pyvips

image = pyvips.Image.black(20000, 20000)

for filename in sys.argv[2:]:
    tile = pyvips.Image.new_from_file(filename, access='sequential')
    x = random.randint(0, image.width - tile.width)
    y = random.randint(0, image.height - tile.height)
    image = image.insert(tile, x, y)

image.write_to_file(sys.argv[1])
```

Before this patch:

```
$ for i in {0..1000}; do cp ~/pics/k2.jpg $i.jpg; done
$ /usr/bin/time -f %M:%e ../manyjoin.py ../x.jpg *.jpg
5456256:4.34
```

With this patch:

```
$ /usr/bin/time -f %M:%e ../manyjoin.py ../x.jpg *.jpg
2475324:3.38
```
2021-11-05 12:14:50 +00:00
John Cupitt 41e92b9ada tiny arrayjoin polish 2021-11-05 10:09:16 +00:00
John Cupitt f0e89ac29b Merge branch 'master' of github.com:libvips/libvips 2021-11-04 17:19:15 +00:00
John Cupitt 778ff7fce5 wider margin for arrayjoin minimise
This patch makes arrayjoin leave a bigger margin off the end of each
input image. This can help some loaders which have large output caches.

See https://github.com/libvips/libvips/issues/2440
2021-11-04 17:17:17 +00:00
Lovell Fuller a274a2f7e6
pngsave: allow valid bitdepth of 16 (#2515) 2021-11-04 16:39:12 +00:00
John Cupitt 30fdc3df77 add jp2k load of untiled images
with this patch, untiled jp2k images are loaded in chunks, saving loads
of memory (but runs much slower)
2021-11-04 15:26:04 +00:00
John Cupitt 3488c6b410 reorder hyperbolic enums to fix an ABI break 2021-11-03 17:57:42 +00:00
John Cupitt 4b7915994f better test for hyperbolics 2021-11-02 23:03:05 +00:00
John Cupitt c6d863f9d3 fix inverse hyperbolics
oop, typo
2021-11-02 22:58:19 +00:00
Heshy Roskes d8c04011ea
Add hyperbolic functions (#2508)
* add hyperbolic functions
* add hyperbolic function tests
* changelog
* add inverse hyperbolic functions for old compilers
2021-11-02 15:05:37 +00:00
Kleis Auke Wolthuizen fc92290bb9
Try the new target API first in `VImage::write_to_buffer` (#2511)
Needed after PR #2499.
2021-11-02 13:36:27 +00:00
Kleis Auke Wolthuizen e95e8c5155
Fix typo in `magick7load` (#2512)
Introduced in commit f92069b.
2021-11-02 12:04:19 +00:00
Kleis Auke Wolthuizen f92069b035
Incorporate #2506 also in {webp,magick7}load (#2507) 2021-11-01 18:33:27 +00:00
Kleis Auke Wolthuizen 9c1003fbe6
Set page height only for multi-page images (#2506) 2021-11-01 16:55:37 +00:00
John Cupitt e412d5bdf0 fix copy/paste error in description 2021-11-01 15:45:03 +00:00
John Cupitt 0c70f3dc7d
add fail-on : better control over loader error handling (#2360)
Instead of a simple fail/don't-fail boolean switch, add fail-on, an enum which sets the sensitivity of loaders to errors. 

There's a new sensitivity level which tries to detect truncated images, but ignores other types of error.
2021-10-31 14:13:18 +00:00
Kleis Auke Wolthuizen 42c8f43432
Improve doc comments (#2504)
* Fix a couple of incorrect doc comments

Helps GIR.

* Add missing doc comment for VIPS_KERNEL_MITCHELL
2021-10-29 13:37:39 +01:00
Kleis Auke Wolthuizen a5bdcd77e0
Include vips.h before checking for G_OS_WIN32 (#2502)
Since this definition originates from GLib, it is necessary to
include vips/vips.h prior to using it.
2021-10-29 11:05:21 +01:00
Kleis Auke Wolthuizen 2d6d2e7c0d
Drop the operation cache before leak checking (#2503) 2021-10-29 11:03:28 +01:00
John Cupitt 47383b5bfc
tell buffer and target savers the file format (#2499)
tell buffer and target savers the file format

Currently, buffer and target savers are not told the format they should
write.

This is usually OK (the JPEG saver already knows it should write JPEG),
but some savers can write several formats, and these currently need an
extra parameter.

For example:

```ruby
buf = x.write_to_buffer ".bmp", format: "bmp"
```

The first ".bmp" gets libvips to pick magicksave, the second
`format:` param is necessary to tell magicksave to write BMP.

This patch adds stub subclasses so that the savers know the exact format. It also improves PPM save.
2021-10-28 18:57:24 +01:00
John Cupitt 1f321d366b disable webp shrink-on-load if it will judder
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
2021-10-27 13:25:04 +01:00
John Cupitt e815e8ad95
Move the filemode ifdefs to a private header (#2498)
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).
2021-10-27 11:37:51 +01:00
Kleis Auke Wolthuizen 5d6e9851ba
Ensure newly created file descriptors are non-inheritable (#2497)
* 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.
2021-10-26 12:20:03 +01:00
John Cupitt ba3bc3099c raise single-chunk limit in jpeg save
It was 65530 for some reason. It's now 65533.

See https://github.com/libvips/libvips/issues/2493
2021-10-21 15:08:48 +01:00
John Cupitt 21567e12b8 note atan2 in changelog 2021-10-20 20:42:23 +01:00
John Cupitt de6e2fef9e add a test for atan2
and tiny formatting changes
2021-10-20 20:40:39 +01:00
John Cupitt 13285c7cfc Merge branch 'master' of https://github.com/indus/libvips into indus-master 2021-10-20 18:41:39 +01:00
John Cupitt 7855fabea3 Merge branch 'master' of github.com:libvips/libvips 2021-10-20 14:28:37 +01:00
John Cupitt 53ee983b51 oop, debug left enabled by mistake 2021-10-20 14:28:15 +01:00
Kleis Auke Wolthuizen 8a1e1eda34
Prefer g_malloc over vips_malloc in vips_blob_copy (#2489)
The use of vips_malloc is not necessary here and could potentially
be slower since it uses g_malloc0 (i.e. calloc).
2021-10-20 14:22:00 +01:00
Kleis Auke Wolthuizen a829a474e5
Remove stray declaration of im__fftproc() (#2487) 2021-10-20 13:01:07 +01:00
Kleis Auke Wolthuizen 1044dd46eb
Move vips__ink_to_vector and im__vector_to_ink to compat (#2488)
It was only used by getpoint in vips8, which is simpler to inline.
2021-10-20 13:00:01 +01:00
John Cupitt 96604dba10 turning on subifd enable pyramid mode
see https://github.com/libvips/pyvips/issues/277
2021-10-20 10:40:03 +01:00
John Cupitt cf1228b927 fix page_height arg for tiffsave
it wasn't wired up, thanks @jacopoabramo

see https://github.com/libvips/pyvips/issues/277
2021-10-20 10:18:22 +01:00
John Cupitt 5e7e914b06 hide some setup loops from --vips-progress
see https://github.com/libvips/libvips/issues/2450
2021-10-19 16:19:20 +01:00
John Cupitt 0f3193b7f2
Add iiif3 (#2483)
* add iiif3 support to dzsave

some small things have changed from v2
2021-10-19 14:18:40 +01:00
John Cupitt b2527da531
allow utf-8 header for svg detection (#2481)
* 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
2021-10-15 13:21:50 +01:00
John Cupitt e1a7063999
move make_resident into modules loading (#2434)
since all libvips modules can't be unloaded
2021-10-14 15:49:22 +01:00
John Cupitt 251e1d1d32
cgifsave per frame cmap (#2445)
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
2021-10-14 15:46:52 +01:00
Lovell Fuller b98366fcb1
Switch to memmove as input buffer can overlap (#2476) 2021-10-12 17:24:40 +01:00
John Cupitt bd8fad842a call JxlEncoderInitBasicInfo
new mandatory API for libjxl v0.6
2021-10-12 17:10:55 +01:00
John Cupitt 444a04e94f formatting, another MCU test 2021-10-08 17:58:17 +01:00
David Manthey 46a67cfab9
Add jpeg restart_interval option. (#2468)
* 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.
2021-10-08 17:33:32 +01:00
John Cupitt f6281284a1 fix VipsSource and named pipes
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
2021-10-08 12:20:24 +01:00
John Cupitt 60bae63644 updale libnsgif from upstream
seems slightly slower overall
2021-10-07 10:48:12 +01:00
John Cupitt 1192d87acf remove old libtiff numeric defines
use the glib ones instead rather than depending on stdint etc.
2021-10-01 17:29:43 +01:00
John Cupitt 33cca3ecbc fix jxload restart
if the loader was restarted (eg by vipsdisp) it could fail to fetch pixels
2021-10-01 12:36:02 +01:00
John Cupitt 6a53ab47e1 allow container jxl as well
We were not testing the jxl signature for the two types of jxl.

see https://github.com/jcupitt/vipsdisp/issues/5

thanks Fraetor
2021-10-01 06:53:37 +01:00
John Cupitt 08742ec304 fix tiff load of tiled packed formats
we were not checking if formats needed repacking for tiled load
2021-09-30 09:48:25 +01:00
John Cupitt 5397fe5a4f note tiff change in changelog 2021-09-29 17:49:26 +01:00
John Cupitt be0b0d17b8 better tiff write looping
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
2021-09-29 17:45:58 +01:00
John Cupitt 1584d0d917 fix comment typo 2021-09-18 14:40:59 +01:00
John Cupitt 024244bfbc don't free global_lcol on shutdown
since we need to be able to call things like error_buf after shutdown in
leak testing
2021-09-18 14:04:05 +01:00
John Cupitt b96ed28903 update docs for vips_shutdown() use
Since we have a new policy.
2021-09-17 19:09:07 +01:00
John Cupitt af61d375bc
experiment with removing shutdown from atexit (#2439)
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.
2021-09-17 19:02:53 +01:00
John Cupitt b221830b5a better memory debug output 2021-09-16 15:46:35 +01:00
John Cupitt 1caad7f228 Merge branch '8.11' 2021-09-13 15:00:21 +01:00
John Cupitt 15416c410d raise the PNG text chunk limit
Raise the PNG text chunk limit to 50, since it seems some real images
have a text chunk per line of exif data.

See https://github.com/libvips/libvips/issues/2433
2021-09-13 14:40:20 +01:00
John Cupitt 7e8af07c66
Fix flatten clip (#2432)
* 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
2021-09-13 11:23:02 +01:00
Kleis Auke Wolthuizen 5ab66e16e1
Fix UBSan errors (#1948)
* 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]
2021-09-12 13:14:24 +01:00
Lovell Fuller f7619cf33e
gifsave: expose bitdepth property (#2429)
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%.
2021-09-10 08:57:12 +01:00
John Cupitt cfd9dc3f01 try to handle mmap failing in source
Some filesystems have mmap disabled. Make vips_source_map() fall back to
read if mmap fails.

See https://github.com/libvips/libvips/discussions/2415
2021-09-08 09:24:36 +01:00
John Cupitt f2dd4471eb tiny code format changes 2021-09-07 13:54:59 +01:00
Lovell Fuller e16cb5bfe5
quantise: optional thresholding of alpha channel (#2425)
Moving this logic from gifsave to quantise improves
the performance of writing RGBA GIFs by ~15%
2021-09-07 12:23:42 +01:00
John Cupitt f8c2a36746 arrayjoin signalling minimise also frees memory
By making the sequential line cache non-persistent, and only minimising
when the read point is well past the image.

On large arrayjoin operations, this saves many GB of memory.

See https://github.com/kleisauke/net-vips/issues/135
2021-09-06 23:14:36 +01:00
John Cupitt 579bdff012 more debug in source.c 2021-09-06 20:26:43 +01:00
John Cupitt a20cd4cdc1 minimise arrayjoin inputs during processing
arrayjoin with a sequential pipeline will now minimise inputs when they
are no longer being used. This drops the number of open file handles
needed to construct large arrays.

Sadly, memory savings are minimal.

see https://github.com/kleisauke/net-vips/issues/135
2021-09-06 20:22:29 +01:00
John Cupitt 99724e6097 safer stop-early logic in tilecache
Don't actually stop the tilecache loop early, since that could deadlock,
instead just stop fetching from the pipeline.

see https://github.com/libvips/libvips/pull/2424
2021-09-05 12:55:52 +01:00
John Cupitt e7889ff8e1 stop cache tile generation early on error
We didn't stop tile calculation as early as we could on error.

See https://github.com/libvips/libvips/pull/2424
2021-09-05 12:46:11 +01:00
Lovell Fuller affc2400ed
heifload: switch demand to thinstrip (#2424)
Ensures decoding errors halt processing
2021-09-05 12:42:55 +01:00
John Cupitt 6f9d3ecf91 Merge branch '8.11' 2021-09-05 12:00:20 +01:00
Kleis Auke Wolthuizen 632badabe1
Ensure vips_thumbnail doesn't send an axis to 0 (#2416) 2021-09-05 11:58:44 +01:00
Lovell Fuller 4d079f1691
gifsave: use cgif namespaced API (#2422)
See https://github.com/dloebl/cgif/pull/18
2021-09-03 12:04:28 +01:00
John Cupitt 307d24eea7 Merge branch '8.11' 2021-08-30 14:02:28 +01:00
John Cupitt b62287a792 check .v enums more carefully 2021-08-30 14:02:03 +01:00
Lovell Fuller bd8093ab71 Handle error values when guessing interpretation (#2421) 2021-08-30 12:30:55 +01:00
Lovell Fuller 4aaed60573 Ensure VIPS_CODING_ERROR is handled for vips images (#2420) 2021-08-30 12:30:43 +01:00
Lovell Fuller 01c39d0774
Ensure VIPS_CODING_ERROR is handled for vips images (#2420) 2021-08-29 20:16:31 +01:00
Lovell Fuller 30897e8e36
Handle error values when guessing interpretation (#2421) 2021-08-29 20:15:24 +01:00
John Cupitt b9230edcbe Merge branch '8.11' 2021-08-29 19:13:12 +01:00
John Cupitt 451cfcd282 small cleanups from "unlimited" option 2021-08-29 19:08:51 +01:00
Joshua Sager bb88490a17 Introduce unlimited flag, enabling unlimited text chunks in PNGs (#2419)
* Introduce unlimited flag, enabling unlimited text chunks

* remove extraneous optional flag causing GLib-GObject-CRITICAL **: 17:10:34.095: validate_and_install_class_property

* Address feedback from @jcupitt

* various compilation error fixes

* Interlace detection uses unlimited=false

* attempt to fix tests

* documentation changes, introduced MAX_PNG_TEXT_CHUNKS and bumped max to 20 (was 10)
2021-08-29 18:41:49 +01:00
Joshua Sager 608a7cee9b
Introduce unlimited flag, enabling unlimited text chunks in PNGs (#2419)
* Introduce unlimited flag, enabling unlimited text chunks

* remove extraneous optional flag causing GLib-GObject-CRITICAL **: 17:10:34.095: validate_and_install_class_property

* Address feedback from @jcupitt

* various compilation error fixes

* Interlace detection uses unlimited=false

* attempt to fix tests

* documentation changes, introduced MAX_PNG_TEXT_CHUNKS and bumped max to 20 (was 10)
2021-08-29 18:06:33 +01:00
John Cupitt b0b8e6ee65 small style changes 2021-08-23 01:14:37 +01:00
Lovell Fuller 1f5d6f6bc9
Add gifsave operation, depends on cgif and libimagequant (#2381) 2021-08-22 18:11:41 +01:00
John Cupitt e60f11eb45 fix rank fast path
there was an off-by-one error which could cause an out of bounds read

see https://github.com/libvips/libvips/issues/2401
2021-08-16 17:46:25 +01:00
John Cupitt 9d186c9cd4 Merge branch '8.11' 2021-08-14 18:17:11 +01:00
John Cupitt 3ccf1761dd Merge branch '8.11' of github.com:libvips/libvips into 8.11 2021-08-07 18:47:41 +01:00
John Cupitt 57d8dd3ece better jp2k save behaviour
- don't enable mct if subsampling is on
- don't make such deep pyramids
2021-08-07 18:46:50 +01:00
Kleis Auke Wolthuizen 1611afee7e
Fix a few -Wstrict-aliasing=1 warnings (#2380) 2021-08-07 18:11:36 +01:00
John Cupitt 1ce301812d Merge branch '8.11' 2021-08-06 17:00:24 +01:00
John Cupitt fd1a036cd8 limit number of PNG chunks
reduces the threat of PNG decompression bombs
2021-08-06 10:55:08 +01:00
John Cupitt e93a23e0b7 Merge branch '8.11' 2021-08-05 12:29:11 +01:00
John Cupitt 5263686511 limit the number of text chunks in PNGs
very large numbers of text chunks can cause high memory use
2021-08-05 12:28:22 +01:00
John Cupitt 3d77c6abaa tiny layout fix 2021-08-05 11:24:29 +01:00
John Cupitt 8082063607 rename webp reduction-effort as effort
though effort still works
2021-07-30 11:07:43 +01:00
John Cupitt ff1260df1c rename heifsave "speed" param as "effort"
For consistency with the rest of libvips. "speed" still works.
2021-07-30 10:59:12 +01:00
Lovell Fuller aabb1555d2
pngsave: expose quantisation effort setting (#2367) 2021-07-30 10:43:42 +01:00
John Cupitt 9221fae973 remove some stray dbg code
accidentally committed previously
2021-07-29 13:19:11 +01:00
John Cupitt b4582dbdaa set CFLAGS for magick API detect
since it will try to compile and link code fragments
2021-07-29 13:12:29 +01:00
Lovell Fuller 81009d3e4c heifload: verify page dimensions are non-zero 2021-07-25 21:47:55 +01:00
John Cupitt 11818e1caf Merge branch 'master' of github.com:libvips/libvips 2021-07-19 09:17:30 +01:00
Adil Benameur 37c82c8e2a added the jxl save functions to foreign.h 2021-07-19 07:54:03 +01:00
John Cupitt d21ee5aa2b remove double space 2021-07-19 07:51:44 +01:00
Adil Benameur 914c7cf185 added the jxl save functions to foreign.h 2021-07-19 01:28:00 +02:00
John Cupitt 2b0aae2d72
Merge pull request #2298 from libvips/update-svgload-to-latest
update svgload to work with latest librsvg
2021-07-18 18:58:32 +01:00
John Cupitt 2cebec9a80 stop text output getting too large
see https://github.com/libvips/libvips/issues/2300
2021-07-18 18:53:47 +01:00
John Cupitt 2041f228f5 fix thumbnail with small plus crop plus no upsize
thumbnail could fail for small images if upsize was disallowed and crop
was enabled, thanks Andrewsville

see https://github.com/libvips/libvips/issues/2157
2021-07-18 15:00:35 +01:00
John Cupitt dd4b11063a special case for **-1
Since it's very common.

See https://github.com/libvips/libvips/discussions/2352
2021-07-16 13:06:15 +01:00
John Cupitt b493b16e54 Merge branch '8.11' 2021-07-16 10:23:19 +01:00
John Cupitt 6946c3b9d9 start up threadpool later
might help php and ruby web frameworks

see eg. https://github.com/libvips/php-vips-ext/issues/42
2021-07-14 20:21:38 +01:00
John Cupitt 6dd6fafa2a Merge branch '8.11' 2021-07-03 11:47:26 +01:00
John Cupitt 70182e4eac don't load modules if they are built in
Only load modules if libvips has been built as a set of modules.
Otherwise can can end up loading operations twice.
2021-07-03 11:14:58 +01:00
John Cupitt d14d5eed25 Merge branch '8.11' 2021-07-02 17:20:21 +01:00
John Cupitt d4c5556c83 fix jp2k pyramid generation
8.11.1 broke it, unfortunately
2021-07-02 17:19:27 +01:00
John Cupitt 951e900a32 fix libdir directory guessing on windows 2021-07-02 17:18:46 +01:00
John Cupitt ec1d1abf50 Merge branch '8.11' 2021-07-02 12:35:24 +01:00
John Cupitt d07dee8b0c better libdir guessing
take the lib directory name (eg. "lib64" etc.) from the configure
time libdir
2021-07-02 11:50:34 +01:00
John Cupitt 5fff62576e more dbg output 2021-06-30 17:22:35 +01:00
John Cupitt 7e5312f626 more dbg code 2021-06-30 14:30:02 +01:00
Remi Collet c7f7fc52e8 use /lib64 instead of /lib when needed 2021-06-29 17:35:33 +01:00
John Cupitt 757d031005 always check the return of vips_image_pipeline()
For consistency. Although I don't think it can meaningfully fail.
2021-06-29 16:12:17 +01:00
John Cupitt ea5972055f Merge branch '8.11' 2021-06-28 20:33:51 +01:00
John Cupitt 8851150375 fix some tabs 2021-06-28 20:32:56 +01:00
John Cupitt 4ee12e5675 trim some dead code 2021-06-28 20:31:09 +01:00
John Cupitt 95bf1367ba fix jpeg tiff pyramid save
we were not copying the quant tables on lower pyr levels correctly

add a test too
2021-06-28 20:24:00 +01:00
John Cupitt b7e723fcc7 Merge branch '8.11' of github.com:libvips/libvips into 8.11 2021-06-28 16:48:41 +01:00
John Cupitt a8c45be816 fix arg type for TIFFTAG_SUBIFD
We were passing int* when TIFFGetField wanted unit16, so subifd counts
could sometimes be wrong.
2021-06-28 16:43:55 +01:00
John Cupitt 5539e7951a
Merge pull request #2318 from lovell/svgload-check-dimensions
svgload: skip images with invalid dimensions
2021-06-28 15:32:19 +01:00
Lovell Fuller d1c038c22d svgload: skip images with invalid dimensions 2021-06-28 14:21:40 +01:00
John Cupitt 1b3dda5b24 enable strip chopping on TIFF load
see https://github.com/libvips/libvips/discussions/2322

thanks DavidStorm
2021-06-28 12:30:04 +01:00
John Cupitt 7512e410ca add svgload_string
simple convenience function for C
2021-06-28 11:45:56 +01:00
John Cupitt 067d603182 oop typo 2021-06-23 12:26:21 +01:00
John Cupitt 706c2a112d Merge branch '8.11' 2021-06-23 12:25:43 +01:00
John Cupitt 40a04fdbc1 improve startup info 2021-06-22 18:39:41 +01:00
John Cupitt eeb64b6968 change init prefix fallback order
Use the configure time prefix second rather than going straight to
search. This should help ruby-vips on homebrew.
2021-06-22 18:09:57 +01:00
John Cupitt 1cd4b848e7 enable info output earlier 2021-06-22 15:38:54 +01:00
John Cupitt b9034bf731 more startup debug output
if VIPS_INFO is set
2021-06-22 15:28:21 +01:00
John Cupitt 336ee9420a Merge branch '8.11' of github.com:libvips/libvips into 8.11 2021-06-22 14:18:22 +01:00
John Cupitt 5f28f67d4c fix build with jp2k debug enabled 2021-06-22 14:15:05 +01:00
John Cupitt ed035670b6
Merge pull request #2308 from remicollet/issue-lib64
use /lib64 instead of /lib when needed
2021-06-18 11:51:12 +01:00
Keim, Stefan f75f698ab4 Add atan2 to math2 2021-06-18 11:14:02 +02:00
Remi Collet ea48b6a482 use /lib64 instead of /lib when needed 2021-06-15 15:17:35 +02:00
DarthSim f15fd3eae0 Unref source on vips_foreign_load_pdf_close 2021-06-15 17:26:55 +06:00
John Cupitt 16a6c08af7 update svgload to work with latest librsvg
rsvg_handle_render_cairo() is deprecated
2021-06-11 10:35:17 +01:00
John Cupitt 06b429955a Merge branch 'master' into 8.11 2021-06-09 13:23:20 +01:00
John Cupitt 4b0fd255de
Merge pull request #2293 from DarthSim/fix/svg-error-leak
Delete Cairo context on rsvg_handle_render_cairo error
2021-06-09 13:22:17 +01:00
DarthSim b8f7fb6d20 Delete Cairo context on rsvg_handle_render_cairo error 2021-06-09 17:41:37 +06:00
John Cupitt e96fc955bc comment reason for thread_execute revert 2021-06-07 14:30:21 +01:00
John Cupitt 939437d56e Merge commit '4c263a36e9e728b5ab5cc1f4f3cafe5738a6b6e7' into 8.11 2021-06-07 14:26:58 +01:00
Kleis Auke Wolthuizen 4c263a36e9 Don't run sinkscreen thread in threadpool
Since threads on Windows can be terminated prior to the execution
of the atexit registered functions (i.e. vips_shutdown), causing
a surprising deadlock. This thread is never recycled, so it should
be fine.

Reverts commit d1b4d12388 partially.
2021-06-07 14:39:47 +02:00
John Cupitt 6804ff61df load non-transparent GIFs as RGB
And GIFs with transparent elements as RGBA. This can make downstream
processing (eg. in vipsdisp) much quicker since it can save a
composite.
2021-06-07 09:54:53 +01:00
John Cupitt f39e2e271d don't invalidate in sinkscreen
it was called from a bg thread and could race when under heavy load, eg.
vipsdisp displaying animated jpg images
2021-06-06 16:53:00 +01:00
John Cupitt 3870baef33 free argv0 a little later 2021-06-01 19:02:41 +01:00
John Cupitt 43efbde995
Merge pull request #2276 from okft/master
Clean up more resources in vips_shutdown
2021-06-01 19:00:06 +01:00
GOUJON Évan 3015bb4eeb Clean up more resources in vips_shutdown 2021-06-01 19:32:59 +02:00
John Cupitt eca400e953 don't set g_set_prgname()
this should be set in the app layer, not by libraries
2021-06-01 10:29:54 +01:00
GOUJON Évan 3e9da95b84 Clean up more resources in vips_shutdown 2021-05-31 19:13:57 +02:00
John Cupitt 889ca96648 allow 10,000 frame GIFs
the old limit was 1,000, which was a little low
2021-05-25 14:08:19 +01:00
John Cupitt 98d35dda28 vips_text() was missing a couple of unlocks 2021-05-25 14:07:28 +01:00
John Cupitt dca526405e revise old comment 2021-05-25 14:06:47 +01:00
Kleis Auke Wolthuizen 1562ba695a Ensure compatibility with Cygwin
G_PLATFORM_WIN32 is no longer defined for Cygwin.
2021-05-17 11:54:46 +02:00
John Cupitt def025da3e reorganise loadable modules
- heifload operation now defined in heifload.c, etc.
- C API wrappers moved to foreign.c
2021-05-17 09:45:27 +01:00
John Cupitt f637206e8d move vips_threadpool_push to internal API
and rename as vips__thread_execute()
2021-05-17 08:42:39 +01:00
John Cupitt 77ab3d2562 fix build with non-standard libheif location 2021-05-16 20:44:50 +01:00
John Cupitt dac75219b2 fix warning on 32-bit platforms 2021-05-16 17:47:04 +01:00
John Cupitt e52a0d3912 more libjxl dbg output 2021-05-15 13:37:19 +01:00
John Cupitt d577b18e69 oop, dropped a comment 2021-05-11 18:10:54 +01:00
John Cupitt eef3f9568d revise threadpool comments and docs 2021-05-11 10:23:05 +01:00
John Cupitt e00ca4e6b7 make jxlload/save a loadable module 2021-05-10 16:45:28 +01:00
John Cupitt 7391418d09 revise comment 2021-05-08 20:15:10 +01:00
John Cupitt 6d9308d93c fix a couple of compiler warnings 2021-05-08 19:51:01 +01:00
John Cupitt 98946e5e15
Merge pull request #2235 from kleisauke/reuse-threads
Reuse threads by using the thread pool of GLib (#2038)
2021-05-08 18:52:04 +01:00
John Cupitt 0d7dd3be7c limit jxlload image size
We were not checking the reported image size against VIPS_MAX_COORD,
leading to some glib out-of-range errors downstream.
2021-05-08 15:25:53 +01:00
John Cupitt 37988cef83 stop jxl header decode earlier
Previously, jxl header decode waited for JXL_DEC_NEED_IMAGE_OUT_BUFFER status.
But libjxl will actually allocate a lot of memory for decode before this
point, and this exposes jxlload to memory bombs.

This patch stops after JXL_DEC_COLOR_ENCODING, ie. just after the last
section before pixel data. This lets us get all image metadata, but
does no pixel buffer allocation.
2021-05-08 14:39:34 +01:00
John Cupitt 41cff4e9d0 Merge branch 'master' of github.com:libvips/libvips 2021-05-05 17:32:36 +01:00
John Cupitt a2e5717e82 Merge branch '8.10' 2021-05-05 17:32:25 +01:00
John Cupitt e19acd5148 fix load of large PPM images from a pipe
large PPM images loaded over pipes could cause a crash, thanks ewelot

see https://github.com/libvips/libvips/issues/2240
2021-05-05 17:29:50 +01:00
akash-akya e39142bab2 Update doc for vips_image_get_string 2021-05-05 18:23:11 +05:30
John Cupitt 0e861d7325 improve jxl eof detection
... again
2021-05-05 12:00:21 +01:00
John Cupitt e480cfbe97 jxlload was not detecting EOF correctly
it could loop in some circumstances
2021-05-05 11:47:04 +01:00
John Cupitt b87f5ba615 add a missing rewind to jxlload 2021-05-04 19:06:22 +01:00
Kleis Auke Wolthuizen 83575e347a Use gatomicrefcount in sinkscreen 2021-05-03 13:21:45 +02:00
Kleis Auke Wolthuizen 060ab7c7a2 Free the calculated pixel buffer cache early
Since threads can be reused, we need to free the
calculated pixel buffer cache early (i.e. during
vips_thread_shutdown).

This (partially) reverts commit 1a915db.
2021-05-03 13:21:45 +02:00
Kleis Auke Wolthuizen 91a143e5c9 Swap g_private_set with g_private_replace where possible
There's a possibility that the old GDestroyNotify
handler is not called when threads are being reused.
2021-05-03 13:21:45 +02:00
Kleis Auke Wolthuizen d1b4d12388 Move sink_disc and sink_screen threads to threadpool
And deprecate the vips_g_thread_new and vips_g_thread_join
functions.
2021-05-03 13:21:45 +02:00