Pipelining to custom GS delegate fails

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
divis

Pipelining to custom GS delegate fails

Post by divis »

Hi,

I created a delegate for CMYK-PDF to transparent PNG Conversion:

Code: Select all

<delegate decode="pdf2png" command=""/opt/local/bin/gsx" -q -dQUIET -dPARANOIDSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 "-sDEVICE=pngalpha" -dTextAlphaBits=4 -dGraphicsAlphaBits=4 "-r%x" -dUseCIEColor "-sOutputFile=%o" "-f%i""/>
inputfile is a CMYK PDF.

Following works just fine:

Code: Select all

convert -units PixelsPerInch -density 300x300 pdf2png:inputfile -background "#ff9900" -flatten -thumbnail 256x256 -units PixelsPerInch -density 72x72 png:-
But piping the document fails:

Code: Select all

cat inputfile | convert -units PixelsPerInch -density 300x300 pdf2png:- -background "#ff9900" -flatten -thumbnail 256x256 -units PixelsPerInch -density 72x72 png:-

Code: Select all

Error: /undefinedfilename in (/var/folders/QK/QKoi7mXGFy8q+AUGTEFlwk+++TI/-Tmp-/magick-J6cWQkiJ)
delegate failed `"/opt/local/bin/gsx" -q -dQUIET -dPARANOIDSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 "-sDEVICE=pngalpha" -dTextAlphaBits=4 -dGraphicsAlphaBits=4 "-r%x" -dUseCIEColor "-sOutputFile=%o" "-f%i"'
convert: unable to open image `/var/folders/QK/QKoi7mXGFy8q+AUGTEFlwk+++TI/-Tmp-/magick-6Z7xdGmO': No such file or directory @ error/blob.c/OpenBlob/2491.
convert: unable to open file `/var/folders/QK/QKoi7mXGFy8q+AUGTEFlwk+++TI/-Tmp-/magick-6Z7xdGmO': No such file or directory @ error/constitute.c/ReadImage/571.
convert: missing an image filename `png:-' @ error/convert.c/ConvertImageCommand/2970.
I'm using IM 6.6.2-0, GS 8.71, Mac OS X 10.6.3

I searched all the forums and docs but didn't get it - any help or hint is highly appreciated.
Post Reply