Page 1 of 1

Example using convert command with time limit

Posted: 2011-07-17T17:58:24-07:00
by peterpham
i believe that you can use -limit time to restrict how long the convert to be timeout.
But I cannot find an example how to use it.

I was trying to convert multiple page PDF to PNGs and using this following command to limit it to 10seconds:

Code: Select all

convert -limit time 10 input.pdf output.png
The process, indeed, did time out but after about 1 minute.
I wonder whether I had use wrong syntax, or the 10sec limit was only started count down during convert command but not when GhostScript was running.

Also, when trying convert with option -limit memory, as in

Code: Select all

convert -limit memory 512MiB input.pdf output.png
checking Activity Monitor (MAC OSX) as well as using top command, the real memory shows that:
- There was a few seconds when the process's memory took over 1GB
- Most of the time, the memory took around 550MB.
In either case, the memory seems to exceed the set limit of 512MiB.
Is there any other resources including in this real memory consumption?

Thanks

Re: Example using convert command with time limit

Posted: 2011-07-17T21:09:01-07:00
by anthony
The timer is only checked during the normal IM processing. IM has no control over how other programs such as ghostscript takes.

I do have a wrapper script that tries to timeout a command that the script runs..
http://www.ict.griffith.edu.au/anthony/ ... e/#timeout
Note this is not strictly a IM solution, but a general shell scripting solution.
linux also provides a similar command for timing out applications.

I make no guarantees.