imagemagick time limit
Posted: 2007-01-20T07:55:57-07:00
Is there a posibility to set a timeout (time limit) for imagemagick (convert in special)?. I have seen limitations for disk, memory ...., but not for time.
Use https://github.com/ImageMagick/ImageMagick/discussions instead.
https://imagemagick.com/discourse-server/
https://imagemagick.com/discourse-server/viewtopic.php?t=8257
Code: Select all
TIMEOUT=60
timeout_convert() {
# lookup the users disk quota but with a timeout
convert "$@" &
# now ensure that the above command does not run too long
cmd_pid=$!
( sleep $TIMEOUT
echo >&2 "Quota Timeout"
kill -9 $cmd_pid 2>/dev/null
) &
kill_pid=$!
wait $cmd_pid
kill $kill_pid 2>/dev/null