Commit Graph

37 Commits

Author SHA1 Message Date
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
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 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
Kleis Auke Wolthuizen 6fd38df95a Build a dynamically loadable module for OpenSlide
By default, a dynamically loadable module is built for OpenSlide (i.e.
`--with-openslide=module`) when:
* OpenSlide is found;
* GModule is supported (`gmodule_supported` pkg-config variable).

This can be overridden on the command line with:
* `--without-openslide` - to disable OpenSlide usage;
* `--with-openslide[=yes]` - to restore the previous behavior;
* `--disable-modules` - to disable the build of dynamic modules.
2021-04-22 12:28:37 +02:00
John Cupitt a7acdf567c source rewind reenables sniff mode
so you can rewind most sources after reading (though not pipes)
2021-01-21 14:30:46 +00:00
John Cupitt 42af1cec36 add vipsload_source
plus small openslideload_source fixes
2020-12-31 19:47:36 +00:00
John Cupitt babbb086f9 add openslideload_source 2020-12-30 14:14:08 +00:00
John Cupitt 080ab87d37 Merge branch 'master' into HEAD 2019-04-11 16:18:39 +01:00
John Cupitt e106e1d100 add n/page params to webpload
and renumber all optional load args
2018-11-01 20:43:07 +00:00
John Cupitt 28391dbfc7 option to attach associated images as metadata
you now see:

```
$ vipsheader -a CMU-1.svs[attach_associated] | grep ass
openslide.associated.label: 387x463 uchar, 4 bands, rgb
openslide.associated.macro: 1280x431 uchar, 4 bands, rgb
openslide.associated.thumbnail: 1024x732 uchar, 4 bands, rgb
slide-associated-images: label, macro, thumbnail
```
2018-01-27 16:43:58 +00:00
Alistair Thomas 0506c49444 Update GObject introspection annotations for libvips/foreign directory 2017-09-26 23:39:06 +01:00
John Cupitt e213a9ded6 remove @fail machinery from openslideload
since openslide load errors are fatal ... see

bb0a6643f9 (commitcomment-19838911)
2016-11-16 07:41:31 +00:00
John Cupitt bb0a6643f9 move @fail from jpegload into the base load class
and add fail support to csv and openslide

see https://github.com/jcupitt/libvips/issues/546
2016-11-12 15:33:35 +00:00
John Cupitt c90b8be0b8 add tiffsave_buffer
add tests

also some cleanups to foreign include files

see https://github.com/jcupitt/libvips/issues/417
2016-10-15 12:29:14 +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 90536d2268 try openslide before jpeg
MRXS images are also JPEG images, so we need to have openslide before
libjpeg in the file test order.

See https://github.com/jcupitt/libvips/issues/406
2016-03-29 17:26:22 +01:00
John Cupitt 9ddca0e99e change @whole_slide to @autocrop
on seconds thoughts, make openslide crop-on-load an option, not the
default

also, clip image bounds against image size
2014-07-31 09:04:32 +01:00
John Cupitt 639c22bf53 add "whole_slide" toggle
openslideload now crops to image bounds (if set) ... use @whole_slide to
stop this autocrop
2014-07-30 12:27:19 +01:00
John Cupitt c85dd26627 oops, better filename set on foreign load
we were setting the filename in the wrong place
2014-06-10 13:46:05 +01:00
Benjamin Gilbert 2e8d014811 update for new format support in OpenSlide 3.4.0 2014-01-25 02:31:20 -05: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
Benjamin Gilbert c98d65434b bump minimum OpenSlide version to 3.3.0
- Avoid deprecated API

- Drop unneeded g_log handler
2012-09-20 03:11:49 -04:00
Benjamin Gilbert 6e74234ba7 add Leica filename suffix
newly-supported in OpenSlide 3.3.0.
2012-09-20 02:59:00 -04:00
Benjamin Gilbert d6e16adcc7 convert remaining layer variables to level
For consistency with openslide2vips.c.
2012-04-11 12:41:15 -04:00
Benjamin Gilbert c96cfaa695 convert "layer" to "level" where externally visible
OpenSlide >= 3.3.0 will use the term "level" instead of "layer".
To avoid gratuitous incompatibility between libvips 7.28 and later
versions, change this now in the openslideload argument, the
"slide-layer" metadata item, and error messages.
2012-02-28 16:53:26 -05:00
John Cupitt 71fed4a614 add a vips7 openslide reader stub 2012-01-17 11:43:02 +00:00
John Cupitt 0983b50905 Merge remote-tracking branch 'origin/gobject-introspection' into goi-merge
Conflicts:
	TODO
	libvips/arithmetic/im_recomb.c
	libvips/arithmetic/im_stats.c
	libvips/deprecated/im_measure.c
	libvips/include/vips/header.h
	libvips/include/vips/image.h
	libvips/include/vips/object.h
	libvips/iofuncs/header.c
	libvips/iofuncs/image.c
	libvips/iofuncs/object.c
2011-12-24 17:36:55 +00:00
John Cupitt 3e45e2cd6b move rad over to the new thing 2011-12-20 14:57:05 +00:00
John Cupitt a2ed2edb5d fix --without-tiff etc. 2011-12-13 13:19:20 +00:00
John Cupitt 968c84e478 openslide needs suffs 2011-12-12 12:08:01 +00:00
John Cupitt 18d54ea3d2 final openslide cleanups 2011-12-12 11:58:36 +00:00
John Cupitt 05fbb6b3bc fix up openslideload
there was a problem with the tile cache ... plus some small tidies
2011-12-12 11:34:28 +00:00
John Cupitt 230e9ce63e move openslide to a new-style class 2011-12-11 22:01:39 +00:00