nlfiedler / magick-rust

Rust bindings for ImageMagick
https://crates.io/crates/magick_rust
Apache License 2.0
256 stars 68 forks source link

Expose resource management API #79

Open glebpom opened 3 years ago

glebpom commented 3 years ago

Is there a way to limit the number of allowed threads to use?

Command Line client supports that through -limit thread 1 argument

nlfiedler commented 3 years ago

I'm not familiar with all of the features of MagickWand, but from what I can see, there is nothing about threads, other than the library is thread-safe. Is there a specific function with which you are concerned?

glebpom commented 3 years ago

It seems like it is reachable through the SetMagickResourceLimit API. This method is generated as a part of bindgen step:

extern "C" {
    pub fn SetMagickResourceLimit(arg1: ResourceType, arg2: MagickSizeType) -> MagickBooleanType;
}
nlfiedler commented 3 years ago

Thanks for the link. I've changed the title to reflect that this is a request for exposing the resource management API in ImageMagick. It's a fairly simple procedure, but I would want to have a means of testing it, and I'm preoccupied with other work at the moment. If you have the interest, by all means, please submit a pull request.