Commit Graph

1305 Commits

Author SHA1 Message Date
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
Kleis Auke Wolthuizen 42c8f43432
Improve doc comments (#2504)
* Fix a couple of incorrect doc comments

Helps GIR.

* Add missing doc comment for VIPS_KERNEL_MITCHELL
2021-10-29 13:37:39 +01: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 e815e8ad95
Move the filemode ifdefs to a private header (#2498)
The filemode ifdefs had grown to 30 lines of code duplicated in four
source files. Move to a single copy in a private header (not part of the
public API).
2021-10-27 11:37:51 +01:00
John Cupitt de6e2fef9e add a test for atan2
and tiny formatting changes
2021-10-20 20:40:39 +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
Kleis Auke Wolthuizen a829a474e5
Remove stray declaration of im__fftproc() (#2487) 2021-10-20 13:01:07 +01:00
Kleis Auke Wolthuizen 1044dd46eb
Move vips__ink_to_vector and im__vector_to_ink to compat (#2488)
It was only used by getpoint in vips8, which is simpler to inline.
2021-10-20 13:00:01 +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
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 7e8af07c66
Fix flatten clip (#2432)
* fic gtk-doc typenames in cgif

* fix flatten clipping

flatten could produce out of range values if max_alpha was less than
the limit of the numeric range of the format

https://github.com/libvips/libvips/issues/2431
2021-09-13 11:23:02 +01:00
Lovell Fuller 1f5d6f6bc9
Add gifsave operation, depends on cgif and libimagequant (#2381) 2021-08-22 18:11:41 +01:00
Adil Benameur 914c7cf185 added the jxl save functions to foreign.h 2021-07-19 01:28:00 +02:00
John Cupitt 7512e410ca add svgload_string
simple convenience function for C
2021-06-28 11:45:56 +01:00
Keim, Stefan f75f698ab4 Add atan2 to math2 2021-06-18 11:14:02 +02:00
Kleis Auke Wolthuizen 4c263a36e9 Don't run sinkscreen thread in threadpool
Since threads on Windows can be terminated prior to the execution
of the atexit registered functions (i.e. vips_shutdown), causing
a surprising deadlock. This thread is never recycled, so it should
be fine.

Reverts commit d1b4d12388 partially.
2021-06-07 14:39:47 +02:00
John Cupitt eca400e953 don't set g_set_prgname()
this should be set in the app layer, not by libraries
2021-06-01 10:29:54 +01:00
John Cupitt f637206e8d move vips_threadpool_push to internal API
and rename as vips__thread_execute()
2021-05-17 08:42:39 +01:00
Kleis Auke Wolthuizen 060ab7c7a2 Free the calculated pixel buffer cache early
Since threads can be reused, we need to free the
calculated pixel buffer cache early (i.e. during
vips_thread_shutdown).

This (partially) reverts commit 1a915db.
2021-05-03 13:21:45 +02:00
Kleis Auke Wolthuizen d1b4d12388 Move sink_disc and sink_screen threads to threadpool
And deprecate the vips_g_thread_new and vips_g_thread_join
functions.
2021-05-03 13:21:45 +02:00
Kleis Auke Wolthuizen 80e0cc3d12 Reuse threads by using GLib's threadpool 2021-05-03 13:21:45 +02:00
John Cupitt edcdf8af70 rebase add-jp2ktiff on master 2021-04-26 15:16:20 +01:00
John Cupitt 9e6389bd38
Merge pull request #2181 from libvips/add-jxl
Add JPEG-XL support
2021-04-25 16:20:57 +01:00
Kleis Auke Wolthuizen 221a5f7e8b Remove remnant of gmic
This was moved to a plugin with commit 927b2d7.
2021-04-22 12:01:42 +02:00
John Cupitt c7f69718da start adding jxl 2021-04-01 09:21:41 +01:00
John Cupitt 69fcf1b9e9
Merge branch 'master' into add-openjpeg 2021-03-27 15:22:13 +00:00
John Cupitt 595f5a1b71 make autosubsample more consistent
always disable subsample for Q>=90, and update docs too
2021-03-27 15:16:38 +00:00
John Cupitt fb6891d02b typo in header 2021-03-20 14:22:06 +00:00
John Cupitt 2575d963bd add jp2k tests
and buffer load/save
2021-03-20 12:16:10 +00:00
John Cupitt 454f448c5b add jp2ksave
works, but not quite done
2021-03-19 11:49:07 +00:00
John Cupitt 7d69f6bc84 small fix to openexr load 2021-03-18 12:47:03 +00:00
John Cupitt c2eebacf5a start adding jp2k load 2021-03-17 11:31:25 +00:00
Kleis Auke Wolthuizen 3ed50e0427 Cleanup configure.ac and #ifdef's 2021-03-06 15:47:07 +01:00
John Cupitt 8dc2db9789 add gif background colour as metadata 2021-02-20 04:52:02 +00:00
John Cupitt 4f762d6609 add vips_niftiload_source() 2021-02-12 15:29:58 +00:00
John Cupitt cfe50903df don't put glib includes inside extern "C" blocks
see https://github.com/libvips/libvips/issues/1987
2021-02-09 16:07:51 +00:00
John Cupitt 1f4f975e7d make leak test exit with an error code
and run the libvips leak test in CI
2021-02-08 11:25:56 +00: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 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
John Cupitt babbb086f9 add openslideload_source 2020-12-30 14:14:08 +00:00
John Cupitt f368c0add9 try to get the path for the stream 2020-12-28 18:26:02 +00:00
John Cupitt 98be88bf80 add sourceginput
This is a source which wraps a GInputStream. You can use this to eg.
efficiently load a PNG file from a GFile object.
2020-12-28 15:14:36 +00:00
John Cupitt 013e8beba7 Merge branch '8.10' 2020-11-11 10:06:22 +00:00
John Cupitt 6894159ad5 fix icc-profiles and dzsave --no-strip
We were not copying metadata down pyramid layers in dzsave, so
--no-strip didn't allow icc profiles on tiles.

Thanks altert

See https://github.com/libvips/libvips/issues/1879
2020-11-11 10:02:46 +00:00
John Cupitt a1ae0d1d68 revise BGRA->RGBA 2020-10-17 13:42:57 +01:00
Kleis Auke Wolthuizen e0b3e53c0e Speed up VIPS_ARGUMENT_COLLECT_SET
By using G_VALUE_COLLECT_INIT, see:
https://bugzilla.gnome.org/show_bug.cgi?id=603590
2020-10-10 19:48:52 +02:00
John Cupitt 727eb2ee39 Merge branch '8.10' 2020-10-03 18:29:23 +01:00
John Cupitt 0ee8b1e844 improve seek on pipes
There were a few issues in VipsSource around seeking on pipes. With this
patch, EOF detection is better, and pipe sources automatically turn into memory
sources when EOF is hit.

see https://github.com/libvips/libvips/issues/1829
2020-10-03 18:25:24 +01:00
John Cupitt 25bd6cce6f
Merge branch 'master' into master 2020-09-24 10:31:01 +01:00