Commit Graph

24 Commits

Author SHA1 Message Date
John Cupitt 19009b15a9 revise loader demand hints
Add a check that header and load methods agree on the demand hint, and
make sure all loaders pass.

If they disagree, you can get bad performance in some cases, since the
pipeline can be built from the header dhint.
2022-09-03 15:31:37 +01:00
John Cupitt f4cd55ddf5 tweak popperload tile size
to make it big enough for an A4 page at 300dpi
2022-08-26 13:14:44 +01:00
John Cupitt d27dfbe55d revise help text for loaders
Hopefully to make it clearer and more consistent.

See https://github.com/libvips/libvips/discussions/2982
2022-08-10 12:50:53 +01:00
Kleis Auke Wolthuizen cdf12dd849
Mark Poppler as untrusted (#2855) 2022-06-11 16:25:28 +01:00
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
John Cupitt 586fb31550 switch svgload to random access
and fix up pdfload random access
2022-06-05 15:57:43 +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
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
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
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 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
Kleis Auke Wolthuizen 9c1003fbe6
Set page height only for multi-page images (#2506) 2021-11-01 16:55:37 +00: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 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 991cc4f88b rename as pdfload 2016-02-08 20:25:03 +00:00
John Cupitt bff4157773 add load pdf from buffer 2016-02-08 17:48:18 +00:00
John Cupitt b7030d004a add file type sniffing 2016-02-08 17:04:31 +00:00
John Cupitt 5db2c64d90 add @scale option
and set xres/yres
2016-02-08 16:57:37 +00:00
John Cupitt adfd25a5ed byteswap popplerload
and better path absoluteization
2016-02-08 16:37:47 +00:00
John Cupitt be574be539 popplerload hacking
metadata, relative filenames
2016-02-08 14:41:57 +00:00
John Cupitt a7192ce8c6 update notes 2016-02-08 10:00:18 +00:00
John Cupitt a41a1d5c33 popplerload seems to work
though it's not been tested much
2016-02-08 09:30:33 +00:00
John Cupitt 8da4e706dd start adding poppler support 2016-02-07 23:33:43 +00:00