Commit Graph

1706 Commits

Author SHA1 Message Date
John Cupitt 9713a71bf0 block resolutions < 0
since they can trigger a sanity failure in the test suite
2022-03-22 15:09:13 +00:00
John Cupitt 1b97b52318 clarify draw docs
see https://github.com/libvips/libvips/discussions/2733
2022-03-22 10:03:36 +00:00
John Cupitt a77519f7c3 try to improve docs
see https://github.com/libvips/libvips/discussions/2733#discussioncomment-2412590
2022-03-22 09:10:34 +00:00
John Cupitt 3073ee90b7
Improve edge handling for mapim (#2681)
* almost there

* smol changes

* getting close now

segv on the test suite, annoyingly

* argh still not quite thert

* phew
2022-02-28 09:12:09 +00:00
John Cupitt 9d841e848f more init check to libvips base class
helps introspection run correctly if there's no vips_init()
2022-02-27 18:48:37 +00: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
Kleis Auke Wolthuizen 50a74ceeec
Mark some functions and variables as static (#2691)
These are only used in the same file, and not exported.
2022-02-27 13:41:39 +00:00
Lovell Fuller 6639b90f22
window: delay setting ref count (#2690)
fixes an assert fail in window_free
2022-02-27 09:50:04 +00:00
Kleis Auke Wolthuizen a8b48e1442
Add missing annotations to #endif directives (#2678) 2022-02-23 11:55:40 +00:00
Kleis Auke Wolthuizen 1e4cd2d5c2
Fix building with -Dmodules=disabled (#2676)
* Fix building with -Dmodules=disabled

* Reformat line [skip ci]
2022-02-23 10:32:02 +00:00
Kleis Auke Wolthuizen d80185060d
Various improvements to the build systems (#2675)
* Meson: remove space before colon

Since key-value pairs in Python are usually delimited as
colon+space instead of space+colon+space.

* Meson: disable modules by default when building static libraries

Corresponds to autotools. See: #2323.

* Meson: make modules a feature option

Corresponds to autotools, where modules are built
automatically if enabled and supported.

* Meson: specify minimum required GLib version

* Meson: fix indentation

* Remove unused function checks

* Simplify GLib configure checks

* Meson: ensure modules doesn't include enumtypes sources

Since that would cause duplicate symbols.

(`soname_header` can also be safely removed here,
since that is already included in `libvips_headers_dep`)
2022-02-22 14:33:42 +00:00
Kleis Auke Wolthuizen 3da7caee6c
LSan improvements and fixes (#2672)
* LSan: remove GLib suppression

* LSan: disable the fast unwinder to get full stacktraces

* Move ASan/UBSan fuzzer options to CI configuration

* LSan: remove EOLed python2.7 suppression

* LSan: remove libstdc++ suppression

* LSan: add libx265 to suppression file

* Try to reproduce small memleak

* Try a possible patch

* Skip test if `im_benchmark` is not available

* CI: upgrade Clang version to 13

* CI: correct job names

* Meson: increase the timeout for tests

* README.md: correct Meson invocation
2022-02-19 15:13:42 +00:00
John Cupitt dc069f8892 ooop typo 2022-02-18 09:53:40 +00:00
John Cupitt 01a9947006 remove atexit use
too unreliable to be useful
2022-02-17 14:30:02 +00:00
John Cupitt f6dafd6fc6 update changelog for intospection fixes
and default on, since there are now so few warnings
2022-02-15 10:59:11 +00:00
Corentin Noël 69bf2be12b
Enhance the introspection support by fixing annotations (#2657)
Also refine the .metadata file
2022-02-15 10:54:40 +00:00
John Cupitt 82a8df2a1f fix some more small introspection warnings 2022-02-15 10:10:21 +00:00
John Cupitt 362adae8c6
Revert "Enhance the introspection support by fixing annotations (#2655)" (#2656)
This reverts commit 47796dcda0.
2022-02-15 10:08:07 +00:00
Corentin Noël 47796dcda0
Enhance the introspection support by fixing annotations (#2655)
* Ensure that double asterisk characters are only used for gtk-doc comments

This triggers warnings when parsing the files with the introspection scanner
and gtk-doc

* Enhance the introspection support by fixing annotations

Also refine the .metadata file

Co-authored-by: John Cupitt <jcupitt@gmail.com>
2022-02-15 09:54:32 +00:00
John Cupitt 257d84108e fix some more introspection warnings 2022-02-15 09:48:01 +00:00
Corentin Noël 542dd06999
Refine header inclusion to allow better introspection generation (#2654)
The headers need to be self-contained for the introspection parser
to work correctly. The entry for external users remains vips/vips.h
2022-02-15 05:02:07 +00:00
Corentin Noël 02901436d4
Add meson build system (#2637)
Allows to use the Meson build system to build the project.
2022-02-08 15:19:36 +00:00
John Cupitt 0d8056b8c5 fix a few small compiler warnings 2022-02-03 14:28:22 +00:00
John Cupitt 8c668303f8 improve the pixel rng
see https://github.com/libvips/libvips/issues/2642
2022-02-02 18:15:26 +00:00
John Cupitt 260b2ddf92
Fix read from pipe with variable chunk sizes
free the header cache only once it's exhausted
2022-01-24 11:27:22 +00:00
John Cupitt 65d84d1cbe fix a crash with 0 length vectors 2021-12-16 10:45:10 +00:00
John Cupitt cd80b5ae94 note win fd change in changelog 2021-12-06 13:58:46 +00:00
Lovell Fuller b28ee777ab
Windows: don't set create time for invalid/stream fd (#2571) 2021-12-06 13:52:02 +00:00
John Cupitt 80f2581e0c expand the docs for vips_shutdown()
see https://github.com/libvips/libvips/discussions/2540
2021-11-16 10:56:43 +00: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
Kleis Auke Wolthuizen fc92290bb9
Try the new target API first in `VImage::write_to_buffer` (#2511)
Needed after PR #2499.
2021-11-02 13:36:27 +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
Kleis Auke Wolthuizen a5bdcd77e0
Include vips.h before checking for G_OS_WIN32 (#2502)
Since this definition originates from GLib, it is necessary to
include vips/vips.h prior to using it.
2021-10-29 11:05:21 +01:00
Kleis Auke Wolthuizen 2d6d2e7c0d
Drop the operation cache before leak checking (#2503) 2021-10-29 11:03:28 +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
Kleis Auke Wolthuizen 5d6e9851ba
Ensure newly created file descriptors are non-inheritable (#2497)
* Cleanup unused defines

* win32: do not inherit open file handles in child processes

`O_NOINHERIT` and the `N` flag of `fopen` is available in all
supported Windows versions.

* unix: ensure any open file handles are closed on exec

`O_CLOEXEC` is available since Linux 2.6.23 and is ignored on
earlier versions. `e` flag of `fopen` is available since glibc 2.7.
2021-10-26 12:20:03 +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 8a1e1eda34
Prefer g_malloc over vips_malloc in vips_blob_copy (#2489)
The use of vips_malloc is not necessary here and could potentially
be slower since it uses g_malloc0 (i.e. calloc).
2021-10-20 14:22:00 +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 e1a7063999
move make_resident into modules loading (#2434)
since all libvips modules can't be unloaded
2021-10-14 15:49:22 +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 1584d0d917 fix comment typo 2021-09-18 14:40:59 +01:00
John Cupitt 024244bfbc don't free global_lcol on shutdown
since we need to be able to call things like error_buf after shutdown in
leak testing
2021-09-18 14:04:05 +01:00
John Cupitt b96ed28903 update docs for vips_shutdown() use
Since we have a new policy.
2021-09-17 19:09:07 +01:00
John Cupitt af61d375bc
experiment with removing shutdown from atexit (#2439)
remove shutdown from atexit

Because atexit() can be called at almost any point during process termination,
including after worker threads have been force-quit, we can't use it for
cleanup.

New policy: use vips_shutdown() explicitly if you need to clean up,
though it's optional. Only use atexit() for leak checking.
2021-09-17 19:02:53 +01:00
John Cupitt b221830b5a better memory debug output 2021-09-16 15:46:35 +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
John Cupitt cfd9dc3f01 try to handle mmap failing in source
Some filesystems have mmap disabled. Make vips_source_map() fall back to
read if mmap fails.

See https://github.com/libvips/libvips/discussions/2415
2021-09-08 09:24:36 +01:00
John Cupitt 579bdff012 more debug in source.c 2021-09-06 20:26:43 +01:00
John Cupitt 307d24eea7 Merge branch '8.11' 2021-08-30 14:02:28 +01:00
John Cupitt b62287a792 check .v enums more carefully 2021-08-30 14:02:03 +01:00
Lovell Fuller bd8093ab71 Handle error values when guessing interpretation (#2421) 2021-08-30 12:30:55 +01:00
Lovell Fuller 4aaed60573 Ensure VIPS_CODING_ERROR is handled for vips images (#2420) 2021-08-30 12:30:43 +01:00
Lovell Fuller 01c39d0774
Ensure VIPS_CODING_ERROR is handled for vips images (#2420) 2021-08-29 20:16:31 +01:00
Lovell Fuller 30897e8e36
Handle error values when guessing interpretation (#2421) 2021-08-29 20:15:24 +01:00
John Cupitt b493b16e54 Merge branch '8.11' 2021-07-16 10:23:19 +01:00
John Cupitt 6946c3b9d9 start up threadpool later
might help php and ruby web frameworks

see eg. https://github.com/libvips/php-vips-ext/issues/42
2021-07-14 20:21:38 +01:00
John Cupitt 6dd6fafa2a Merge branch '8.11' 2021-07-03 11:47:26 +01:00
John Cupitt 70182e4eac don't load modules if they are built in
Only load modules if libvips has been built as a set of modules.
Otherwise can can end up loading operations twice.
2021-07-03 11:14:58 +01:00
John Cupitt d14d5eed25 Merge branch '8.11' 2021-07-02 17:20:21 +01:00
John Cupitt 951e900a32 fix libdir directory guessing on windows 2021-07-02 17:18:46 +01:00
John Cupitt ec1d1abf50 Merge branch '8.11' 2021-07-02 12:35:24 +01:00
John Cupitt d07dee8b0c better libdir guessing
take the lib directory name (eg. "lib64" etc.) from the configure
time libdir
2021-07-02 11:50:34 +01:00
Remi Collet c7f7fc52e8 use /lib64 instead of /lib when needed 2021-06-29 17:35:33 +01:00
John Cupitt ea5972055f Merge branch '8.11' 2021-06-28 20:33:51 +01:00
John Cupitt 067d603182 oop typo 2021-06-23 12:26:21 +01:00
John Cupitt 706c2a112d Merge branch '8.11' 2021-06-23 12:25:43 +01:00
John Cupitt 40a04fdbc1 improve startup info 2021-06-22 18:39:41 +01:00
John Cupitt eeb64b6968 change init prefix fallback order
Use the configure time prefix second rather than going straight to
search. This should help ruby-vips on homebrew.
2021-06-22 18:09:57 +01:00
John Cupitt 1cd4b848e7 enable info output earlier 2021-06-22 15:38:54 +01:00
John Cupitt b9034bf731 more startup debug output
if VIPS_INFO is set
2021-06-22 15:28:21 +01:00
Keim, Stefan f75f698ab4 Add atan2 to math2 2021-06-18 11:14:02 +02:00
Remi Collet ea48b6a482 use /lib64 instead of /lib when needed 2021-06-15 15:17:35 +02:00
John Cupitt e96fc955bc comment reason for thread_execute revert 2021-06-07 14:30:21 +01:00
John Cupitt 939437d56e Merge commit '4c263a36e9e728b5ab5cc1f4f3cafe5738a6b6e7' into 8.11 2021-06-07 14:26:58 +01: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 f39e2e271d don't invalidate in sinkscreen
it was called from a bg thread and could race when under heavy load, eg.
vipsdisp displaying animated jpg images
2021-06-06 16:53:00 +01:00
John Cupitt 3870baef33 free argv0 a little later 2021-06-01 19:02:41 +01:00
John Cupitt 43efbde995
Merge pull request #2276 from okft/master
Clean up more resources in vips_shutdown
2021-06-01 19:00:06 +01:00
GOUJON Évan 3015bb4eeb Clean up more resources in vips_shutdown 2021-06-01 19:32:59 +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
GOUJON Évan 3e9da95b84 Clean up more resources in vips_shutdown 2021-05-31 19:13:57 +02:00
John Cupitt 889ca96648 allow 10,000 frame GIFs
the old limit was 1,000, which was a little low
2021-05-25 14:08:19 +01:00
Kleis Auke Wolthuizen 1562ba695a Ensure compatibility with Cygwin
G_PLATFORM_WIN32 is no longer defined for Cygwin.
2021-05-17 11:54:46 +02: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
John Cupitt dac75219b2 fix warning on 32-bit platforms 2021-05-16 17:47:04 +01:00
John Cupitt d577b18e69 oop, dropped a comment 2021-05-11 18:10:54 +01:00
John Cupitt eef3f9568d revise threadpool comments and docs 2021-05-11 10:23:05 +01:00
John Cupitt 7391418d09 revise comment 2021-05-08 20:15:10 +01:00
John Cupitt 6d9308d93c fix a couple of compiler warnings 2021-05-08 19:51:01 +01:00
John Cupitt 98946e5e15
Merge pull request #2235 from kleisauke/reuse-threads
Reuse threads by using the thread pool of GLib (#2038)
2021-05-08 18:52:04 +01:00
akash-akya e39142bab2 Update doc for vips_image_get_string 2021-05-05 18:23:11 +05:30
Kleis Auke Wolthuizen 83575e347a Use gatomicrefcount in sinkscreen 2021-05-03 13:21:45 +02: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 91a143e5c9 Swap g_private_set with g_private_replace where possible
There's a possibility that the old GDestroyNotify
handler is not called when threads are being reused.
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 4144049174 Remove mutex lock for VipsThreadStartFn
vips_{avg,deviate,hough,max,min,stats} are the only arithmetic functions
that do not require a mutex on the _start and/or _stop function. All
other arithmetic functions still needs this, so move it to sink instead.
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