Commit Graph

492 Commits

Author SHA1 Message Date
John Cupitt e2c2866fc6 tweak docs, add changelog notes
and an assert for semaphore_down_timeout

see https://github.com/libvips/libvips/pull/3253
2023-01-03 12:09:24 +00:00
Kleis Auke Wolthuizen 848a119faa
threadset: stop idle threads after a regular timeout (#3253)
* Add `vips_semaphore_down_timeout` to public API

In preparation for the next commit.

* threadset: stop idle threads after a regular timeout

In line with the previous behaviour of GLib's threadpool.

* threadset: fix a small memory leak

* threadset: ensure idle threads are freed on exit

GLib threads are spawned with `ref_count == 2`, this reference is
decreased during thread exit and associated resources are freed
during `g_thread_join()`. However, idle threads that are stopped
after a regular timeout are not joined. To fix this, decrease the
reference count during `vips_threadset_add()` and increase it just
before joining the thread with `g_thread_join()`.

See:
2d5d990c6a/glib/gthread.c (L522)
2d5d990c6a/glib/gthread-posix.c (L1287)

* Deprecate `vips_g_thread_join()` in favor of `g_thread_join()`

* nit: remove extra semicolon
2023-01-03 12:00:35 +00:00
John Cupitt 7e961b4671 Merge branch '8.13' 2022-08-02 14:22:27 +01:00
John Cupitt 2c4c039056 add "unlimited" to jpegload
To disable DoS limits for JPEG loading. Adding API on a stable branch is
bad, but this fixes a regression, so I think it's necessary,
unfortunately.

See https://github.com/libvips/libvips/issues/2973
2022-08-02 13:50:09 +01:00
John Cupitt 538aa2a841
remove autotools (#2941)
* remove autotools

It seems to all work. I tested with gtk-doc enabled. I probably missed a
few things argh.

* oop, forgot m4/
2022-07-24 11:14:52 +01:00
John Cupitt d9f31be67d configure should add meson files to make dist
add meson.build etc. to EXTRA_DIST

see https://github.com/libvips/libvips/issues/2876
2022-06-20 15:04:33 +01:00
John Cupitt 5f82491d74 small configure improvements
- disable deprecated warnings for /deprecated
- detect librsvg rsvg_handle_get_intrinsic_size_in_pixels()
- tiny comment typo in meson.build
2022-05-16 14:45:53 +01:00
Kleis Auke Wolthuizen 07edfe37b1
Improve symbol visibility (#2688)
* Improve symbol visibility

* Decorate required internal symbols with VIPS_API

* Remove a couple of stray header decls

* Incorporate review comment

- Ensure symbol visibility is also set on static libraries.
- Prefer to use `cc.has_function_attribute('visibility:hidden')`.

* Don't export internal deprecated symbols

* Move deprecated symbols to vips7compat.h

* `IM_FORMAT_H` -> `VIPS_FORMAT_H`

* Move `vips_window_ref` compat stub to `vips7compat.c`

* Disable deprecation warnings internally

* `vips_image_get_kill` -> `vips_image_iskilled`

* Ensure API compatibility

* Add missing include directives

* Move `vips__init` decl to vips7compat

* Move `vips__get_sizeof_vipsobject` to vips7compat

* Fix introspection build

* Fix 2 introspection warnings

* Ensure compatibility with vipsdisp

/usr/bin/ld: tilesource.o: in function `tile_source_new_from_source':
vipsdisp/tilesource.c:1627: undefined reference to `vips__region_no_ownership'
2022-04-16 10:58:55 +01:00
Kleis Auke Wolthuizen 330ebf3cd7
Mosaicing fixes and improvements (#2705)
* Fix segv in `vips_mosaic1`

* Fix ref handling in `rotjoin_search`

* Pass `oarea` to `vips_affine` as `VipsArrayInt` instead

* Flip X/Y positions in `vips__coeff`

* Fix `-Wunused-but-set-variable` warning

* Deprecate unused mosaicing arguments

* Remove a couple of stray header decls
2022-03-03 20:10:20 +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 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
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 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 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 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 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
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
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
John Cupitt a560d7df50 better vips7 compat
revise the vips7 PNG wrapper to work with libspng, though performance
may be poor

thanks SkyDiverCool

https://github.com/libvips/libvips/issues/2233
2021-04-30 08:20:19 +01:00
John Cupitt a0663ddce7 fix build with spng 2021-01-05 15:45:28 +00:00
John Cupitt 58b6d73a70 deprecate vips_popen()
it didn't work well on win, and we no longer use it anyway
2020-07-27 15:21:59 +01:00
Kleis Auke Wolthuizen 9226303b1c Add missing vips7 compat wrappers
For im_{lr,tb}mosaic and im_correl.
2020-07-13 15:38:09 +02:00
John Cupitt e728e5638d
Merge pull request #1697 from kleisauke/wasm-function-pointers
Support for use in WASM environments (#192)
2020-07-03 02:09:39 +01:00
John Cupitt 3c071a8ebb more the rest of mosaicing into private API
chkpair, lr|tbmosaic, etc.
2020-07-02 12:35:37 +01:00
John Cupitt 0803de07e7 move vips__lr|tbmerge to private API 2020-07-01 17:31:25 +01:00
Kleis Auke Wolthuizen 9246094033 Fix function pointer cast issues
It is undefined behavior in C and C++ to cast a function pointer
to another type and call it that way. This does work in most native
platforms, however, despite it being UB, but in WASM it can fail.

See:
https://emscripten.org/docs/porting/guidelines/function_pointer_issues.html
2020-06-30 13:35:41 +02:00
Kleis Auke Wolthuizen c3da8ee583 Convert the mosaicing directory to vips8 2020-06-18 14:36:46 +02:00
Kleis Auke Wolthuizen 8a5dc95fb6 Convert the morphology directory to vips8 2020-06-18 14:29:42 +02:00
John Cupitt 981d5c4b16 revise autorot system
- deprecate vips_autorot_get_angle() since orientation is no longer a
simple rotate
- add vips_image_get_orientation() and vips_image_get_orientation_swap()
- revise tiff and jpeg loader autorotate to just call vips_autorot(),
but only if necessary
- revise thumbnail autorotate too
2020-06-06 17:25:46 +01:00
John Cupitt dc29f8dde6 add subifd select to tiff load 2020-05-28 12:40:31 +01:00
John Cupitt 9ef8b55218 better handling of short files in vips7 compat
the sniffer could read beyond the end of the file sometimes
2020-03-04 17:38:41 +00:00
John Cupitt fe47ce12e9 move csvsave to the new target API 2020-02-21 17:57:28 +00:00
John Cupitt 63d54e5df2 final code cleanups after stream -> source rename 2019-12-30 14:23:51 +00:00
John Cupitt 252996e3ff make check passes after stream -> source rename 2019-12-30 12:48:20 +00:00
John Cupitt 119dd2cb72 pytest passes again after stream -> source/target 2019-12-29 23:08:33 +00:00
John Cupitt 4c5873809f experiment with renaming stream
rename as VipsConnection, VipsSource, VipsTarget etc.

see https://github.com/libvips/libvips/issues/1494#issuecomment-569498619

renamed with this script:

```

set -e

edit() {
        sed -i -E "$1" rename
}

for i in $*; do
        cp $i rename

        edit s/VIPS_STREAMOU/VIPS_TARGET_CUSTOM/g
        edit s/VIPS_STREAMO/VIPS_TARGET/g
        edit s/VIPS_STREAMIU/VIPS_SOURCE_CUSTOM/g
        edit s/VIPS_STREAMI/VIPS_SOURCE/g
        edit s/VIPS_STREAM/VIPS_CONNECTION/g

        edit s/vips_streamou/vips_target_custom/g
        edit s/vips_streamo/vips_target/g
        edit s/vips_streamiu/vips_source_custom/g
        edit s/vips_streami/vips_source/g
        edit s/vips_stream/vips_connection/g

        edit s/VipsStreamou/VipsTargetCustom/g
        edit s/VipsStreamo/VipsTarget/g
        edit s/VipsStreamiu/VipsSourceCustom/g
        edit s/VipsStreami/VipsSource/g
        edit s/VipsStream/VipsConnection/g

        # eg. VIPS_TYPE_STREAM or VIPS_IS_STREAM
        edit "s/VIPS_([A-Z]+)_STREAMOU/VIPS_\1_TARGET_CUSTOM/g"
        edit "s/VIPS_([A-Z]+)_STREAMO/VIPS_\1_TARGET/g"
        edit "s/VIPS_([A-Z]+)_STREAMIU/VIPS_\1_SOURCE_CUSTOM/g"
        edit "s/VIPS_([A-Z]+)_STREAMI/VIPS_\1_SOURCE/g"
        edit "s/VIPS_([A-Z]+)_STREAM/VIPS_\1_CONNECTION/g"

        edit s/streamou/target_custom/g
        edit s/streamo/target/g
        edit s/streamiu/source_custom/g
        edit s/streami/source/g

        # various identifiers which also change
        edit s/is_a_stream/is_a_source/g
        edit s/find_load_stream/find_load_source/g
        edit s/find_save_stream/find_save_target/g
        edit s/new_from_stream/new_from_source/g
        edit s/write_to_stream/write_to_target/g
        edit s/vips_thumbnail_stream/vips_thumbnail_source/g

        # eg. vips_webpload_stream
        edit "s/vips_([a-z]+)load_stream/vips_\1load_source/g"

        # eg. vips_webpsave_stream
        edit "s/vips_([a-z]+)save_stream/vips_\1save_target/g"

        mv rename $i
done
```
2019-12-29 21:40:21 +00:00
John Cupitt 562da3e5ab rename new_from_filename as new_from_file
So VipsStreami matches VipsImage. Same for new_to_filename.
2019-11-22 17:13:20 +00:00
John Cupitt f5a4f41edf rename VipsStream* variables
The convention is now:

	VipStreami *streami;

We had `input` in many places, a left-over from the old VipStreamInput
name.
2019-11-11 09:09:34 +00:00
John Cupitt ee3270f8e9 more refactoring 2019-10-22 11:08:54 +01:00
John Cupitt 226819b8a8 move tiffload to streams
test_descriptors seems to fail now though, odd
2019-10-17 10:58:56 +01:00
John Cupitt 98410042ac add webpload stream
webp uses the new VipsStreamInput mmap interface
2019-10-15 15:46:37 +01:00
John Cupitt 1bdadeed61 add png stream load 2019-10-14 18:03:45 +01:00
John Cupitt 6c1d7db31b remove old jpeg load stuff
it's just stream now

works on buffer, but seems to fail on

	vipsheader йцук.jpg

curiously
2019-10-11 09:43:12 +01:00
John Cupitt 2ab5aa7bf5 fix a used-before-set error in im_vips2dz
we were reading an uninited string in a vips7 compatibility wrapper, thanks
yifengchen-cc

see https://github.com/libvips/libvips/issues/1419
2019-09-03 13:17:18 +01:00
John Cupitt 4af242b599 fix travis compiler warnings
- older libpng don't have consts decls for some set/get funcs
- use g_ascii_strcasecmp() on program text strings (instead of strcasecmp)
2019-02-20 12:49:59 +00: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 5623bb1330 add a nifti wrapper for vips7
so nip2 can now load nifti images
2018-09-10 14:35:49 +01:00