Commit Graph

7960 Commits

Author SHA1 Message Date
Kleis Auke Wolthuizen
07edfe37b1
Improve symbol visibility (#2688)
* Improve symbol visibility

* Decorate required internal symbols with VIPS_API

* Remove a couple of stray header decls

* Incorporate review comment

- Ensure symbol visibility is also set on static libraries.
- Prefer to use `cc.has_function_attribute('visibility:hidden')`.

* Don't export internal deprecated symbols

* Move deprecated symbols to vips7compat.h

* `IM_FORMAT_H` -> `VIPS_FORMAT_H`

* Move `vips_window_ref` compat stub to `vips7compat.c`

* Disable deprecation warnings internally

* `vips_image_get_kill` -> `vips_image_iskilled`

* Ensure API compatibility

* Add missing include directives

* Move `vips__init` decl to vips7compat

* Move `vips__get_sizeof_vipsobject` to vips7compat

* Fix introspection build

* Fix 2 introspection warnings

* Ensure compatibility with vipsdisp

/usr/bin/ld: tilesource.o: in function `tile_source_new_from_source':
vipsdisp/tilesource.c:1627: undefined reference to `vips__region_no_ownership'
2022-04-16 10:58:55 +01:00
Michael Drake
0c3092fa94
libnsgif: Update to latest upstream (#2766)
That's great! Thank you for doing this, Michael.
2022-04-15 18:23:56 +01:00
John Cupitt
55723a980f add a seq to thumbnail_image
otherwise we can get horrible cache thrashing as the shrink will run
without any locality
2022-04-14 10:37:17 +01:00
John Cupitt
eba9ec0dd7
Add a way to disable less well tested operations (#2636)
* quick proposal

warn on startup if untrusted operations might run

use vips_block_untrusted_set() to block untrusted operations, set an env
var or make a file to stop the warning

* mark fits, nifti and svg as untrusted

* remove the annoying "untrusted" warning message

better to warn on the download page

leave vips_block_untrusted_set() since it's obviously useful

* separate UNTRUSTED and BLOCKED

* typos

* add VIPS_BLOCK_UNTRUSTED env var

* move BLOCK_UNTRUSTED after plugin load

obviously, ooops

* add a test, disable *magick

although *magick is fuzzed, it's probably safer to disable it in
untrusted environments

* mark some more operations as untrusted
2022-04-11 11:32:32 +01:00
John Cupitt
6eae6fcf4b stop strip tiff read using tiny tiles
Strip TIFFs with rowperstrip of 1 used to use 1-pixel high cache tiles.
This could slow reading. This patch sets a minimum tile height near 16
but a multiple of the strip size.
2022-04-09 16:38:47 +01:00
Kleis Auke Wolthuizen
6c03343581
Add comments to setjmp invocations (#2751)
Also, pre-increment `num_warnings` to ensure that we really stop
at 100 warnings.
2022-04-06 12:01:18 +01:00
John Cupitt
57cd94278a revise interpretation guesser
This patch pushes the new pyvips interpretation guess rules down into
libvips.

See https://github.com/libvips/pyvips/pull/316
2022-04-05 18:32:25 +01:00
Kleis Auke Wolthuizen
df26bd1e46 Stop JPEG load after 100 warnings (#2749)
See: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=24383
2022-04-05 11:07:29 +02:00
John Cupitt
2dc319b1b1 Revert "stop JPEG load after 20 warnings"
This reverts commit 89bd46d1c4.
2022-04-05 08:34:45 +01:00
John Cupitt
1aebd95387 Revert "improve fail on too many warings"
This reverts commit ae7e5e7a54.
2022-04-05 08:34:20 +01:00
John Cupitt
ae7e5e7a54 improve fail on too many warings
thanks lovell, see 89bd46d1c4 (commitcomment-70409015)
2022-04-04 15:44:37 +01:00
Michael Drake
0f30690360
Update to latest libnsgif (#2747)
* libnsgif: Update to latest upstream.

* nsgifload: Update for new pixel format API.

LibNSGIF now lets the client select a pixel colour component
order. We use NSGIF_BITMAP_FMT_R8G8B8A8, which is the same
format LibNSGIF always decoded to.

* nsgifload: Remove loop_count from VERBOSE output.

This was internal state for a nsgif_frame_prepare() managed
animation, but VIPS doesn't use nsgif_frame_prepare(). The
loop_count member has been removed from the public structure.
2022-04-04 13:57:20 +01:00
John Cupitt
89bd46d1c4 stop JPEG load after 20 warnings
mitigates some DoS attacks somewhat

see https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=24383
2022-04-03 19:21:06 +01:00
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
John Cupitt
356edc3779 revise tests for new libnsgif loop behaviour
see https://github.com/libvips/libvips/pull/2712
2022-03-09 10:20:41 +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
shado23
c02b69eaba
Address review feedback on VRegion (#2684) (#2696)
* Add VRegion8.h to Makefile.am, meson.build, Doxyfile.in.

* Fix inaccurate function documentation.

* Add stride method to VRegion.
2022-02-28 16:17:40 +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