Image processing scripts are mysteriously killed. How do I detrmine why?

169 views Asked by At

I have an account on Bluehost, it's a shared machine. I have been able to run most custom scripts with no problem, but image processing scripts are killed mysteriously after about 20 seconds. No output file is created. Sometimes I can get the command line below to run if I restrict it to monochrome.

I tried ulimit and nice, but I feel I am just guessing. Is there a more methodical way to look into this? Yes, I am also contacting Bluehost support.

~]# gs -q -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT \
> -sDEVICE=png48 -sOutputFile=11006.png 11006.pdf
Killed
~]# echo $?
137
~]#
1

There are 1 answers

0
KenS On

Problem 1 is that there is no png48 device in standard Ghostscript. The most likely problem after that, I'd guess is that its using too much memory, so you need to use controls which will limit the memory usage and instead use the clist (which is a display list implementation), this will take longer but reduce the memory footprint.

Available PNG output devices are png16, png16m, png256, pngalpha, pnggray, pngmono, pngmonod

Use the -dMaxBitmap switch to control the maximum page buffer size, if the page exceeds this then it will use the clist, which will result in 'n' bands. This is slower to process but uses much less memory. You can also use -dNumRenderingThreads if your system has multiple cores.

What version of Linux is this, and what version of Ghostscript, and where did the installed Ghostscript come from (eg did you build it yourself from source ?)

If its a very old version of Ghostscript, it may simply be that it has bugs.