This is usually permissions.


In the script that TS writes and calls, have it do sudo convert …



That will execute convert with higher permissions – which you can refine later 
on.



Also, sometimes it’s not permissions but the working directory or environment 
in general. Sometimes you’ll need to use absolute paths for everything because 
the working directory is different. (you can find the working directory with 
the pwd command)



That /path/to/file/sample.pdf looks suspect.



To debug the exact errors you are seeing you’ll have to try a imagemagick 
and/or ghostscript forum.



Robert







From: Wayne Irvine [mailto:[email protected]]
Sent: Monday, June 29, 2015 6:25 PM
To: [email protected]
Subject: TeraScript-Talk: Ghostscript is a poltergeist



Not sure if this is the right place to ask this but I’m sure some of you guys 
have been through similar situations.



I use Imagemagick (6.7.6-0) to convert manipulate images on my Terascript 
Server (Mac OSX 10.7.5, Terascript 6.2.1). Works well and resizing, blurring 
and combining images. My latest task is to create a jpeg thumbnail from a PDF.



convert -thumbnail x300 /path/to/file/sample.pdf -flatten 
/path/to/image/sample.jpg



If I enter the above in the terminal it works fine. The small jpeg is created 
in the images folder. However, if I use an External action in Terascript to 
call a shell script and pass the arguments through (which is how I do resizes) 
it fails.



The errors in Console are:

29/06/15 10:39:38.114 PM terascript: convert: `%s' (%d) "/opt/local/bin/gsx" -q 
-dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 
-dAlignToPixels=0 -dGridFitTT=2 "-sDEVICE=pngalpha" -dTextAlphaBits=4 
-dGraphicsAlphaBits=4 "-r72x72"  
"-sOutputFile=/var/folders/vj/scmvh99n6sl0h152_6mrsjw80000gn/T/magick-wYNS9NxZ--0000001"
 "-f/var/folders/vj/scmvh99n6sl0h152_6mrsjw80000gn/T/magick-q1vOyVrY" 
"-f/var/folders/vj/scmvh99n6sl0h152_6mrsjw80000gn/T/magick-VFa6s5rk" @ 
error/utility.c/SystemCommand/1896.

29/06/15 10:39:38.114 PM terascript: convert: Postscript delegate failed 
`/path/to/file/sample.pdf': No such file or directory @ 
error/pdf.c/ReadPDFImage/668.

29/06/15 10:39:38.114 PM terascript: convert: missing an image filename 
/path/to/image/sample.jpg' @ error/convert.c/ConvertImageCommand/3017.



I believe the first line is Imagemagick (convert) calling Ghostscript (gsx).

The second is 'Postscript delegate failed' but then erroneously says 'No such 
file or directory’

The third says the target file is missing which is correct.



I also tested the TAF using a jpeg as the input file and it creates the 
thumbnail correctly.



So what we know is:

Terminal/Imagemagick/Ghostscript set up works

Terascript/Imagemagick/Ghostscript doesn’t work

Terascript/Imagemagick works



>From this I conclude that it is a permissions or path issue between Terascript 
>and Ghostscript.

Terascript is running under my local user account which is a member of the 
group ‘admin'.

gsx has the following permissions -rwxr-xr-x.



That is as far as I have got up to now. Any helps in next steps would be 
appreciated.



Wayne Irvine
w: http://www.byteserve.com.au/
p: +61 2 9960 6099
m: 0409 960 609





  _____

To unsubscribe from this list, please send an email to [email protected] 
<mailto:[email protected]>  with "unsubscribe terascript-talk" in the 
body.




----------------------------------------

To unsubscribe from this list, please send an email to [email protected] 
with "unsubscribe terascript-talk" in the body.

Reply via email to