Commit Graph

7612 Commits

Author SHA1 Message Date
Kleis Auke Wolthuizen 31b54056db
cplusplus: only generate doc comments for non-deprecated args (#2505) 2021-11-01 15:21:06 +00:00
John Cupitt 9f37857254 note fail-on in changelog 2021-10-31 14:15:20 +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
John Cupitt 5f101b4f2e Merge branch 'master' of github.com:libvips/libvips 2021-10-29 19:05:40 +01:00
John Cupitt ab464e7b31 add clang-tidy rule
with a few rules
2021-10-29 19:04:42 +01:00
John Cupitt 4f9ea61170 Merge branch 'cl' of https://github.com/neheb/libvips into neheb-cl 2021-10-29 18:25:50 +01: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 a16f118b0c speed up test suite
ouch we were making a huge avif image in memory
2021-10-25 20:40:42 +01:00
Kleis Auke Wolthuizen 29fb557e24
Temporarily skip `test_heifsave` on macOS (#2494) 2021-10-21 18:14:40 +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
John Cupitt 21cdf22535 bump min libjxl version to 0.6 2021-10-12 17:33:32 +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 6e9a23524f add an error message for --with-magickpackage
it was causing some cufusion, see eg. https://github.com/libvips/libvips/discussions/2449
2021-09-29 18:17:48 +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 2501a62fd4 make doxygen default to off
with --enable-doxygen to enable it if you need it, same as gtk-doc
2021-09-24 12:14:13 +01:00
John Cupitt 1584d0d917 fix comment typo 2021-09-18 14:40:59 +01:00
John Cupitt 6acc77505b fix doc link 2021-09-18 14:18:43 +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