Commit Graph

22 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
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 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 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 8d95f9db2b tiny fixes 2021-02-05 16:56:44 +00:00
John Cupitt 690091ba8b fix a refleak in the new vipsload 2021-01-02 18:59:34 +00:00
John Cupitt df3b80fa40 add vipssave_target() 2021-01-02 15:49:32 +00:00
John Cupitt 42af1cec36 add vipsload_source
plus small openslideload_source fixes
2020-12-31 19:47:36 +00:00
Alistair Thomas 0506c49444 Update GObject introspection annotations for libvips/foreign directory 2017-09-26 23:39:06 +01:00
John Cupitt 50468a07a2 clean up foreign
various cosmetic changes:

- pngsave_buffer now uses Write, not WriteBuf, same change for
  radsave_buffer

- move C wrappers out to class defs from foreign.c

- use g_free() not vips_free() for buffer free from low-level savers

- fix var names in some comments

- various style changes for radiance.c
2016-05-24 10:57:02 +01:00
John Cupitt 6ca9a907b8 reorder load tests
and a slight memory saving on ifthenelse
2016-01-13 20:32:23 +00:00
John Cupitt d426abdcd8 stage1 seems to work 2014-06-07 16:47:53 +01:00
John Cupitt 339712fb13 hackey hack 2014-06-06 15:03:12 +01:00
John Cupitt b394948cd1 start hacking in better new from file 2014-06-06 13:46:26 +01:00
John Cupitt e48aee7f47 add .vips as an alternative vips suffix
helps imagemagick, see

http://www.imagemagick.org/discourse-server/viewtopic.php?f=2&t=25445&p=110491#p110491
2014-04-22 09:32:50 +01:00
Benjamin Gilbert 8cc76a6ba3 Update address for Free Software Foundation
Also update LGPLv2.1 license text from the copy currently on the GNU
website.
2013-03-07 00:40:19 -05:00
John Cupitt 65ed140ae3 move im_raw2vips() to a class 2011-12-14 22:51:14 +00:00
John Cupitt 89a65c81d2 fix up foreignflags 2011-12-01 21:59:21 +00:00
John Cupitt 099c0c30d6 move filename into load/save 2011-11-29 17:10:24 +00:00
John Cupitt 935c713e71 sort out jpegload 2011-11-29 12:11:33 +00:00
John Cupitt 56fb2126b8 rename VipsFile as VipsForeign 2011-11-29 11:43:08 +00:00