Re: [gscan2pdf-help] Exit status of user defined tools?
Brought to you by:
ra28145
|
From: Jeff <jf...@po...> - 2017-03-14 15:58:23
|
On 14/03/17 16:37, Alistair Grant wrote: > Is the exit status of user defined tools checked? And where does stderr go? No and nirvana, ATM. The trouble is that tools have all sorts of different ideas on what should be returned and what should end up in stderr. > I'm currently trying to get gscan2pdf running inside a docker image. > It appears to be mostly working, I can scan, delete pages, renumber, > save, etc., but attempting to running textcleaner as a user defined > task fails: > > DEBUG - Free space in /tmp/gscan2pdf-pcQB (Mb): 42126.60546875 (warning at 10) > INFO - textcleaner -e stretch -f 23 -o 6 -T > /tmp/gscan2pdf-pcQB/QZp0Rf3RmN.pnm /tmp/gscan2pdf-pcQB/lPP177XrQd.pnm > ERROR - Exception 425: improper image header > `/tmp/gscan2pdf-pcQB/lPP177XrQd.pnm' @ error/pnm.c/ReadPNMImage/282 > ERROR - Error reading /tmp/gscan2pdf-pcQB/lPP177XrQd.pnm: Exception > 425: improper image header `/tmp/gscan2pdf-pcQB/lPP177XrQd.pnm' @ > error/pnm.c/ReadPNMImage/282. > > The improper image header is raised because the output file, > lPP177XrQd.pnm, is 0 bytes long. > > If I copy and paste the textcleaner command in a separate shell it > succeeds, i.e. I can view lPP177XrQd.pnm successfully. It sounds to me that there is a race condition. i.e. textcleaner returns before the output file is written. I take it that it all works fine outside the Docker image? If so, it is going to be hard to debug. Regards Jeff |