Commit Graph

121 Commits

Author SHA1 Message Date
Kleis Auke Wolthuizen a498680094
Update `glib-mkenums` templates (#2939)
* Avoid writing the full path in enumtypes.h

Helps reproducible builds, as build paths can vary between builds.

* Use g_intern_static_string() for enum/flags type names

We are emitting a static string, so use that shortcut function to
intern it, which will save one allocation.

* Use g_once_init_enter/leave to register enum/flags type names

This is the more modern way, and ensures thread-safety.
2022-07-22 15:33:40 +01:00
John Cupitt 94d8a7d993 tried (and failed) to build against ubuntu nifti
the ubuntu cmake dev files for nifti seem to be broken, and I can't get meson
to add the dependency manually
2022-04-18 15:13:55 +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
John Cupitt 3488c6b410 reorder hyperbolic enums to fix an ABI break 2021-11-03 17:57:42 +00:00
Heshy Roskes d8c04011ea
Add hyperbolic functions (#2508)
* add hyperbolic functions
* add hyperbolic function tests
* changelog
* add inverse hyperbolic functions for old compilers
2021-11-02 15:05:37 +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 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 13285c7cfc Merge branch 'master' of https://github.com/indus/libvips into indus-master 2021-10-20 18:41:39 +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
Keim, Stefan f75f698ab4 Add atan2 to math2 2021-06-18 11:14:02 +02:00
John Cupitt edcdf8af70 rebase add-jp2ktiff on master 2021-04-26 15:16:20 +01:00
Lovell Fuller 3ad7363104 heifsave: add option to control subsample_mode
Defaults to no subsampling when Q>90 for consistency with jpegsave.

Deprecate VipsForeignJpegSubsample enum, replace with more generic
VipsForeignSubsample.
2021-01-13 10:01:34 +00:00
John Cupitt 834234c23c add `all` smartcrop mode
So you can crop to fill as well as crop to fit.

see https://github.com/libvips/libvips/issues/1583
2020-03-19 18:57:40 +00:00
John Cupitt 0a23bf3578 revise formatting, add docs
fix up some formatting from https://github.com/libvips/libvips/pull/1552

plus some other small changes
2020-02-18 17:37:56 +00:00
elad laufer d2b794ec35 - use a single enum and switch that replaces no_subsample, force_subsample 2020-02-17 11:29:57 +02:00
alon-ne f88dab9ccd
Fix gif dispose handling for DISPOSE_BACKGROUND and DISPOSE_PREVIOUS
- Add 'scratch' field to gif that holds temporary 'scratch buffer' used for rendering frames
- For DISPOSE_BACKGROUND: Set background color to transparent instead of 0
- For DISPOSE_BACKGROUND: Write background pixels into scratch after rendering current frame, so it will be used in next frame
- For DISPOSE_PREVIOUS: Save frames that are not disposed into 'previous' field in gif, when DISPOSE_PREVIOUS is specified start with that previous frame. see http://webreference.com/content/studio/disposal.html
- Add "ANIMEXTS1.0" to Application Extension parser
- Graphic Control Extension parser refactor
- Compare file contents to expected images for animated gifs in foreign tests
2020-02-06 17:36:13 +02:00
John Cupitt c14d7c254b add max and min to region_shrink
Add max and min to region_shrink. Useful with tiffsave and dzsave when
the image is (for example) line art. Thanks rgluskin.

See: https://github.com/libvips/libvips/issues/1490
2020-01-24 17:55:11 +00:00
John Cupitt f499cefb0e add iiif layout to dzsave 2019-11-09 20:40:39 +00:00
John Cupitt 52ee3b083f add webp and zstd support to tiffsave
needs some tests still
2019-07-08 10:39:44 +01:00
Lovell Fuller 42f9f78c86 heifsave: expose compression option
improve error messaging, add further suffixes
2019-07-03 13:07:58 +01:00
John Cupitt 080ab87d37 Merge branch 'master' into HEAD 2019-04-11 16:18:39 +01:00
John Cupitt a663a1bb1c add vips_region_fetch() etc.
to help ML applications ... they let us generate lots of small rectangular
areas of images very quickly
2019-03-12 16:00:24 +00:00
John Cupitt e27c290856 glib version change 2019-02-27 14:24:17 +00:00
John Cupitt 9ac5a449f2 add low/high to smartcrop
smartcrop attention had a centre setting, but not low or high

see https://github.com/libvips/libvips/issues/1089
2018-09-22 14:47:40 +01:00
John Cupitt 2c7684669f
Merge branch 'master' into region-shrink-method 2018-06-13 17:13:16 +01:00
John Cupitt 3b1e3e1841 add Mitchell kernel
see https://github.com/jcupitt/libvips/issues/966
2018-06-12 12:55:10 +01:00
John Cupitt 9ac45f42e3 needs testing still 2018-04-30 17:38:32 +01:00
Simon Harris a14f3acdf5 Adds a first cut for region shrink mode 2018-03-28 21:59:17 +11:00
Simon Harris 36076f8294 Adds VipsRegionShrink type 2018-03-28 07:35:49 +11:00
John Cupitt 605d93c92f add SZI container type
and improve the scan-properties file a bit
2018-01-27 12:52:22 +00:00
John Cupitt 487c112807 add VIPS_COMBINE_MIN combining mode
for vips_compass()
2017-11-02 12:34:01 +00:00
John Cupitt 55e577a2fb rename nearest as fill_nearest
avoid a clash with the nearest-neighbour interpolator
2017-11-01 15:06:37 +00:00
John Cupitt 40f20e5e0a Merge branch 'master' into gargsms-text-autofit 2017-10-10 13:04:31 +01:00
John Cupitt 3a43fd4057 vectorize 3 band case
needs to test for gcc though
2017-10-01 19:07:02 +01:00
John Cupitt 0cc786aa14 give up on PDF modes for now
they need colour channels in [0-1], so some sort of RGB only ... come
back to this later
2017-09-28 15:09:57 +01:00
John Cupitt c9a83ac9a8 add the rest of the porter-duff operators
PDF ones next, after a reorganisation
2017-09-28 09:04:55 +01:00
John Cupitt 62bc9b7e1d start to add more blend modes 2017-09-27 22:34:05 +01:00
John Cupitt 7c7c30a601 works!
but only OVER mode at the moment, and it's not especially quick
2017-09-27 08:58:36 +01:00
John Cupitt 64be1d89b5 add gravity 2017-09-20 00:43:17 +01:00
gargsms a3955c6c0a Fix code convention, issues with gravity 2017-09-18 18:34:50 +05:30
gargsms 8f660ab45b [WIP] Autofit text in the requested dimensions 2017-08-01 23:26:24 +05:30
John Cupitt 260180197d done! but needs some tests 2017-05-04 14:54:49 +01:00
John Cupitt 126fdd4f6f update for new goi in ubuntu 17.04 2017-04-13 16:26:15 +01:00
John Cupitt 9e6832b34d add --smartcrop to vipsthumbnail
does the obvious thing
2017-03-08 14:31:00 +00:00
John Cupitt d40773515c add smartcrop 2017-03-01 15:41:26 +00:00
John Cupitt e6b20cbd0f Revert "remove stalling"
This reverts commit 959f412380.
2017-02-27 10:26:32 +00:00
John Cupitt e7ae10ef68 Revert "more UNBUF fixes"
This reverts commit a4d3c2a754.
2017-02-27 10:25:41 +00:00
John Cupitt a4d3c2a754 more UNBUF fixes
try to keep compat better, remove the single-thread-first-tile idea
2017-02-21 16:53:48 +00:00
John Cupitt 959f412380 remove stalling 2017-02-21 15:03:15 +00:00
John Cupitt 2fa3736722 all done, I think 2017-01-06 13:43:43 +00:00