Feature request: time limit reset.

Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
Post Reply
Danack
Posts: 73
Joined: 2013-10-14T10:00:25-07:00
Authentication code: 6789

Feature request: time limit reset.

Post by Danack » 2016-01-31T14:17:51-07:00

This is a feature request to make calls to set the time resource limit be from 'now' rather than it being limit from the time when the first image was processed. i.e. MagickSetResourceLimit(TimeResource, 45); would set the time limit be 45 second from now.

That would be following the model used by PHP's set_time_limit()

The reason I want this is as follows. I have a webserver that uses ImageMagick (through Imagick) to process images. For security and performance reasons, I don't make calls to ImageMagick/Imagick directly from the web-server, but instead have a background task that does the image processing.

Some pseudo-code for the background image processor looks like this:

Code: Select all

$endTime = now() + 3600;
while (time() < $endTime) {
     $imageTask = waitForImageTask();
     $imageProcessor->generateImage($imageTask);
}
I want a limit on the maximum time each single image will take to be processed of 45 seconds. However I also want the image processor to stay up an processing images for longer than 45 seconds at a time. If calling `MagickSetResourceLimit(TimeResource, 45);` from within 'run loop' reset the time limit, that would be lovely.

cheers
Dan

Original discussion:

https://github.com/ImageMagick/ImageMag ... -177600827

User avatar
magick
Site Admin
Posts: 11096
Joined: 2003-05-31T11:32:55-07:00

Re: Feature request: time limit reset.

Post by magick » 2016-01-31T14:36:50-07:00

Thanks for the feature request. We have a patch to to support your feature request in GIT master branch @ https://github.com/ImageMagick/ImageMagick later today. The patch will be available in the beta releases of ImageMagick @ http://www.imagemagick.org/download/beta/ by sometime tomorrow.

Danack
Posts: 73
Joined: 2013-10-14T10:00:25-07:00
Authentication code: 6789

Re: Feature request: time limit reset.

Post by Danack » 2016-02-24T08:14:07-07:00

Hi,

I'd just like to check the exact implementation. Please could you give me a link to the commit that added this?

cheers
Dan

emcconville
Posts: 2
Joined: 2016-03-11T13:06:45-07:00
Authentication code: 1151
Contact:

Re: Feature request: time limit reset.

Post by emcconville » 2016-03-11T13:10:34-07:00


Post Reply