Commit Graph

2180 Commits

Author SHA1 Message Date
Kleis Auke Wolthuizen 1214f942f9
Prefer to use `flags |=` everywhere (#2854)
Use the bitwise OR assignment operator to ensure that derived
classes does not overwrite the flags from the base class. Also,
move the flags from `openslideload_source` to its base class.
2022-06-11 15:40:39 +01:00
Kleis Auke Wolthuizen bae0342d95
Update C++ binding and function list (#2851)
* Update C++ binding and function list

Also, start with a capital letter in descriptions whenever possible.

* Ensure `dzsave_target` is generated
2022-06-10 14:43:44 +01:00
John Cupitt b086b3f61a tiny formatting changes
and we can remove a vips__quantise_get_palette()
2022-06-08 15:43:28 +01:00
Sergey Alexandrovich 19bef959d1
cgifsave: palette change POC (#2824)
* cgifsave: compare palettes instead of frame sum

* Add vips__quantise_image_quantize_fixed function
2022-06-08 15:27:29 +01:00
John Cupitt 2d0c6b364c improve scaling of SVG images
We were not scaling images with fixed absolute dimensions.
2022-06-06 12:08:43 +01:00
John Cupitt 586fb31550 switch svgload to random access
and fix up pdfload random access
2022-06-05 15:57:43 +01:00
Sergey Alexandrovich 4fab8beae9
cgifsave: theshold alpha and check alpha constraint in one pass (#2827)
* cgifsave: theshold alpha and check alpha constraint in one pass

* cgifsave: get rid of sqrt()
2022-06-03 18:49:03 +01:00
John Cupitt af23e9f06c tiny formatting fixes 2022-06-01 12:33:43 +01:00
Sergey Alexandrovich c9b5b8c197
nsgifload: add "palette-bit-depth" header (#2828) 2022-06-01 12:27:10 +01:00
John Cupitt 6260a37136
add libjxl ICC and scRGB support (#2815)
* add ICC and scRGB support

see https://github.com/libvips/libvips/issues/2568

* final polish
2022-05-28 13:55:45 +01:00
Daniel Löbl ed79cfba7e
magicksave: Add bitdepth option (#2819)
* flag to save bmp with bitdepth 1

* magicksave: add bitdepth option

* update comments

* update documentation

* revised based on review comments

Co-authored-by: Thomas Barton <thomasryanbarton@gmail.com>
2022-05-27 11:41:01 +01:00
John Cupitt 2af2ca5ca2 add note about palette sorting by quantisers 2022-05-26 17:41:51 +01:00
Kleis Auke Wolthuizen 550781cd18
spngsave: fix 8bpp palette save with transparency (#2808) 2022-05-26 17:26:26 +01:00
John Cupitt 7121f952d5 revise formatting 2022-05-26 17:25:16 +01:00
Sergey Alexandrovich ba04c5f03f
cgifsave: fill transparent pixels with zeroes (#2823) 2022-05-26 17:23:04 +01:00
John Cupitt a9bfd508f5 revise cgifsave checksum
We were calling it a sum and looking for a change threshold, but really
it's only useful as a checksum and does not have a magnitude. Revise
comments and variable names to reflect this.
2022-05-23 13:17:20 +01:00
John Cupitt 89bbb7981d oop dbg left on 2022-05-23 13:07:38 +01:00
John Cupitt 63962056f0 small formatting fixes 2022-05-23 13:02:44 +01:00
Daniel Löbl f26f0b09b8
cgifsave: reuse global palette, if possible (#2797)
* save GIF palette as metadata

... if there are no local colour tables.

See https://github.com/libvips/libvips/issues/2576

* cgifsave: reuse global palette, if possible

* add reuse_palette parameter

* add reoptimise parameter and reuse palette by default

* attach global palette even if local palettes are present

* add check for presence of use-lct

* Revert "add check for presence of use-lct"

This reverts commit cd0f14e45e8bed8f108ee9666e2569c6355f17eb.

* Revert "attach global palette even if local palettes are present"

This reverts commit 4085b9e14b73c8990e9653ccc6f90477c2a43032.

* move global palette quantization to cgif_build

* rename member variable gct

* update comments

* improve error handling

* update documentation

Co-authored-by: John Cupitt <jcupitt@gmail.com>
2022-05-23 13:01:26 +01:00
John Cupitt 7d3aaf540c small formatting 2022-05-23 12:42:26 +01:00
John Cupitt 047bef50d9 fix spngsave conversion
It was all mixed up. We don't need to call colourspace -- this is done
for us by the SAVEABLE system.

Fixes "vips identity x.png" error, see:

https://github.com/libvips/libvips/pull/2808#issuecomment-1133947162
2022-05-23 11:51:54 +01:00
Kleis Auke Wolthuizen 85c24481be
svgload: recognize dimensions for SVGs without width/height (#2817)
Rather than defaulting to 1928x1080. Also, prefer to use the
`LIBRSVG_CHECK_VERSION` macro instead of our configure checks.
2022-05-23 10:39:53 +01:00
John Cupitt 2ef1b198fb fix deprecation warning 2022-05-21 12:43:57 +01:00
John Cupitt bf614530cd use vips__bgra2rgba() in pdfiumload
slightly quicker, works with any byte order
2022-05-21 10:32:23 +01:00
Sergey Alexandrovich 985fb1d1d0
Don't paint the background if the PDF has transparency (#2804) 2022-05-21 10:17:44 +01:00
Lovell Fuller 7d4cba101c
jxl: remove support for never-implemented JXL_TYPE_UINT32 (#2813) 2022-05-21 09:49:31 +01:00
Lovell Fuller f9ace1724e
Fix a couple of typos in help messages (#2814) 2022-05-21 09:47:51 +01:00
Daniel Löbl 7f8e059dc6
webpsave: add parameter for mixed encoding (#2810)
* webpsave: add mixed parameter

* update changelog

* update webpsave documentation
2022-05-20 18:47:18 +01:00
John Cupitt a9d64bea54
add dzsave to a target (#2718)
* start adding dzsave to a target

made a thing for gsf to write to a target

* fix stray tabs in dzsave

* fix dzsave write to "."

Early versions of libgsf did not support writing to ".", so we had an ugly
workaround, but this should now be OK.

Fixing this ought to make write to target simple

* dzsave_target compiles

no idea if it works though

* seems to work now

creates stray 0 length files though, very odd

* fix stray files from dzsave

next: save to buffer is returning null

* fix buffer flush in dzsave

all tests pass!

* update changelog
2022-05-20 18:38:46 +01:00
John Cupitt f8003bda67
Add tiffsave target (#2798)
* compiles, but untested

* works, but libtiff needs seek for write

next: add seek methods to target

* add target seek and read

seem to work

next: disc temps for disc output

* add libnsgif COPYING

oops, we were missing the COPYING file

see https://github.com/libvips/libvips/issues/2800

thanks mika-fischer

* tiffsave uses a disc temp if it can

* revise temp target rules

only make a disc temp if we are writing to a filesystem target

* add new target methods to targetcustom
2022-05-20 18:38:17 +01:00
John Cupitt 58b53506ff
add vips_target_end (#2802)
since finish did not return an error code

also make sure we don't call target_end from inside _dispose, since that
can't signal error either

see https://github.com/libvips/libvips/issues/2801
2022-05-20 16:38:04 +01:00
Kleis Auke Wolthuizen 6aca41d713
quantise: fix styling (#2807)
Also, use the correct conditional directive in spngsave.
2022-05-20 14:31:16 +01:00
John Cupitt c5ea747f71 Merge branch 'master' of github.com:libvips/libvips 2022-05-18 10:57:56 +01:00
John Cupitt e42d2b46b9 revise SVG scaling, again
we were not defaulting width and height correctly

see https://github.com/lovell/sharp/pull/3230
2022-05-18 10:55:41 +01:00
Kleis Auke Wolthuizen f1b4b0cb1a
Swap size_t with gint64 to catch read errors (#2811)
This is similar to commit 5221df224f.
2022-05-17 22:04:20 +01:00
John Cupitt 793d3116a7 Merge branch 'master' of github.com:libvips/libvips 2022-05-16 14:30:41 +01:00
John Cupitt aa5abf3e7e fix background byte ordering in PDF
the `background` param was BGRA rather than vips-style RGBA

see https://github.com/libvips/libvips/pull/2804
2022-05-16 14:28:53 +01:00
Sergey Alexandrovich 982cbe5f8a
Don't fail if PNG contains too much text chunks (#2803)
Only warn if PNG contains too many text chunks

Update spngload.c
2022-05-15 12:18:06 +01:00
John Cupitt 7561d4e52c add libnsgif COPYING
oops, we were missing the COPYING file

see https://github.com/libvips/libvips/issues/2800

thanks mika-fischer
2022-05-12 09:48:58 +01:00
John Cupitt 5221df224f fix ssize_t / ssize_t confusion 2022-05-11 22:28:34 +01:00
Kleis Auke Wolthuizen 9cbc361269
Allow to modify/create EXIF OffsetTime* tags (#2796)
Available since libexif 0.6.23.
2022-05-10 13:26:09 +01:00
Lovell Fuller 7e64c48ca9
heifsave: allow creation of EXIF metadata (#2794)
Previously only update of input EXIF was possible
2022-05-10 08:14:53 +01:00
Kleis Auke Wolthuizen d91cfa4e53
Allow to modify/create EXIF 2.3 ASCII tags (#2795)
* Allow to modify/create EXIF 2.3 ASCII tags

Make `tag_is_ascii` aware of the EXIF 2.3 ASCII tags that are
available since libexif 0.6.22.

See: https://github.com/kleisauke/net-vips/issues/167

* Fix CI
2022-05-10 08:13:22 +01:00
Michael Drake ceaa2d2096
Update LibNSGIF to latest upstream (#2791)
* libnsgif: Update to latest upstream

* nsgifload: Add palette info to debug output.
2022-05-09 10:20:57 +01:00
John Cupitt 460a19b78e revise arg names
use _ everywhere (we have a few uses of - as a separator)
2022-05-07 14:50:05 +01:00
Daniel Löbl cb55fdcfd8
allow to apply maxerror optimization to frames with alpha channel (#2778) 2022-05-07 12:16:13 +01:00
John Cupitt 20fd8ac0fc support rsvg_handle_get_intrinsic_size_in_pixels
librsvg 2.52+ has this new bit of API for finding the SVG dimensions
2022-04-28 13:01:17 +01:00
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 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