Page 1 of 1

identify fails if called from scanadf script

Posted: 2014-04-06T23:04:33-07:00
by pphilw
I have a script, which is called from scanadf. It converts the scanned pnm to a pdf file, and then calls identify. that call gives the following error:

identify: `%s' (%d) "gs" -q -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 "-sDEVICE=pbmraw" -dTextAlphaBits=4 -dGraphicsAlphaBits=4 "-r72x72" "-sOutputFile=/tmp/magick-8406Y34znpxiu1bz-1" "-f/tmp/magick-8406zpxPelFxv1o8" "-f/tmp/magick-8406-d8anTkmZ5BH" @ error/utility.c/SystemCommand/2029.
identify: Postscript delegate failed `001.pnm.pdf': No such file or directory @ error/pdf.c/ReadPDFImage/713.

Calling identify from the command prompt works fine:
identify 001.pnm.pdf
001.pnm.pdf PDF 612x792 612x792+0+0 16-bit Bilevel Gray 61KB 0.010u 0:00.000

Re: identify fails if called from scanadf script

Posted: 2014-04-07T09:59:32-07:00
by fmw42
just a guess, but your scanadf system probably does not know where Ghostscript is installed

Re: identify fails if called from scanadf script

Posted: 2014-04-07T12:37:57-07:00
by pphilw
Thanks. But ghostscript is in the "standard" path ( /usr/bin/gs ). Also, the scanadf script inherits the shell environment (I checked by executing "env" from within the script). Any idea how to debug this further?

Re: identify fails if called from scanadf script

Posted: 2014-04-07T13:22:18-07:00
by fmw42
try renaming with only one period before pdf

001_pnm.pdf

Re: identify fails if called from scanadf script

Posted: 2014-04-07T20:54:31-07:00
by pphilw
Thanks for the suggestion, but this does not help, either. I created a file test.pdf in my home directory, and the script called from scanadf only executes "identify /home/xxx/test.pdf". Here is the output:

Code: Select all

identify: `%s' (%d) "gs" -q -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 "-sDEVICE=pbmraw" -dTextAlphaBits=4 -dGraphicsAlphaBits=4 "-r72x72"  "-sOutputFile=/tmp/magick-5960NKTiA7Oc3RDu-1" "-f/tmp/magick-5960R2HCXd9VsHLI" "-f/tmp/magick-59601zlxWTKBcBTW" @ error/utility.c/SystemCommand/2029.
identify: Postscript delegate failed `/home/xxx/test.pdf': No such file or directory @ error/pdf.c/ReadPDFImage/713.
identify: `%s' (%d) "gs" -q -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 "-sDEVICE=pbmraw" -dTextAlphaBits=4 -dGraphicsAlphaBits=4 "-r72x72"  "-sOutputFile=/tmp/magick-59623Lic0cn8loKu-1" "-f/tmp/magick-5962ZjgvOwsa3WOI" "-f/tmp/magick-59624XAor9MIyzTW" @ error/utility.c/SystemCommand/2029.
identify: Postscript delegate failed `/home/xxx/test.pdf': No such file or directory @ error/pdf.c/ReadPDFImage/713.
On the other hand, if I call "identify /home/xxx/test.pdf" from the CLI, I get:

Code: Select all

/home/xxx/test.pdf PDF 612x792 612x792+0+0 16-bit Bilevel Gray 61KB 0.000u 0:00.000
Any other ideas?

Re: identify fails if called from scanadf script

Posted: 2014-04-07T21:14:04-07:00
by pphilw
Interestingly, it works if I execute this in my scanadf script like this:

Code: Select all

ssh localhost identify /home/xxx/test.pdf
But this cannot be the "right" solution. I tried to execute it using "bash -c" and "bash -l -c", but none of those work.

Clearly, the "ssh-trick" is not a viable workaround, though.

Re: identify fails if called from scanadf script

Posted: 2014-04-13T17:34:55-07:00
by pphilw
bump?

Re: identify fails if called from scanadf script

Posted: 2014-04-13T18:37:19-07:00
by fmw42
Is 001.pnm.pdf actually created by your script?

Re: identify fails if called from scanadf script

Posted: 2014-04-18T14:26:04-07:00
by pphilw
Is 001.pnm.pdf actually created by your script?
yes