-
-
Notifications
You must be signed in to change notification settings - Fork 699
add "configure" operation #2753
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
This operation can be used to set various library config options, such as vips_block_untrusted_set(). Having these options available as an operation makes like simpler for bindings: they can expose them all via the usual introspection system. Example: ```python pyvips.Image.configure(untrusted_block=True) ```
@kleisauke I thought this might be handy for bindings like NetVips. Rather than having to add API for every libvips configure option, we can just have a single vips operation which lets you set the config options in one place. With this PR (for example), pyvips will instantly let you do: pyvips.Image.configure(untrusted_block=True) Same for lua-vips, ruby-vips, NetVips etc. And we can use the libvips arg system to safely deprecate, rename, add, extend, etc. options in future. What do you think? We should all the other config options too, eg concurrency, leak, etc. etc. |
Add a list of the settings that still need connecting.
Notes:
|
This is interesting. It could prevent a lot of I had a quick attempt to fix the build and add this to NetVips, see: Reading settings would also be nice to have. In C# this would look like this: NetVips.Image.Configure(cacheMax: 1000, cacheMaxFiles: 1000);
NetVips.Image.Configure(out var cacheMax, out var cacheMaxFiles);
Console.WriteLine(cacheMax); // 1000
Console.WriteLine(cacheMaxFiles); // 1000 |
This operation can be used to set various library config options, such
as vips_block_untrusted_set().
Having these options available as an operation makes like simpler for
bindings: they can expose them all via the usual introspection system.
Example: