magick-rust icon indicating copy to clipboard operation
magick-rust copied to clipboard

Expose resource management API

Open glebpom opened this issue 3 years ago • 3 comments

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

Command Line client supports that through -limit thread 1 argument

glebpom avatar Apr 08 '21 11:04 glebpom

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?

nlfiedler avatar Apr 09 '21 02:04 nlfiedler

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;
}

glebpom avatar Apr 09 '21 08:04 glebpom

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.

nlfiedler avatar Apr 10 '21 03:04 nlfiedler