"Transcoding" delegates seem broken

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
andreas.k
Posts: 3
Joined: 2011-11-23T04:55:51-07:00
Authentication code: 8675308

"Transcoding" delegates seem broken

Post by andreas.k »

I've been trying to achieve an ai(pdf) > eps > png conversion (going through eps to get boundingbox fitted to graphics).

I'm using IM 6.7.3-6 x64 Q16 and GS 9.02 x64 on Win7.

One would expect that...

Code: Select all

convert test.ai test.eps
...should invoke the delegate <delegate decode="pdf" encode="eps" ... -sDEVICE=epswrite
but instead the <delegate decode="ps:alpha" ... is invoked and the image is rendered.
Actually I haven't got any of the "direct converting" delegates to run.

Perhaps more troublesome I've tried to create my own format "pdf2png" with an custom decoding delegate and from what I can tell the %i correctly maps to the input file but %o doesn't map to the output file! After writing to %o IM will still complain that it can't open file XYZ which isn't the same that %o pointed to.

Here's a simple example illustrating this problem:
In ~/.magick/delegates.xml:

Code: Select all

<delegate decode="ak" command="convert rose: "png:%o""/>
Command with output:

Code: Select all

c:\>convert -verbose ak: test.png
convert rose: "png:C:/Users/ANDREA~1.KAR/AppData/Local/Temp/magick-q6eCeGUC"
convert.exe: unable to open module file `C:\Program Files\ImageMagick-6.7.3-Q16\modules\coders\IM_MOD_RL_AK_.dll': No such file or directory @ warning/module.c/GetMagickModulePath/683.
convert.exe: no decode delegate for this image format `C:/Users/ANDREA~1.KAR/AppData/Local/Temp/magick-wikt5fLw' @ error/constitute.c/ReadImage/566.
convert.exe: missing an image filename `test.png' @ error/convert.c/ConvertImageCommand/3016.
Notice how the two temp-filenames are different. Isn't that wrong?

/Andreas
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: "Transcoding" delegates seem broken

Post by magick »

Try this command:
  • convert test.ai -define delegate:bimodal=true test.eps
andreas.k
Posts: 3
Joined: 2011-11-23T04:55:51-07:00
Authentication code: 8675308

Re: "Transcoding" delegates seem broken

Post by andreas.k »

That gives me an error:

Code: Select all

c:\tmp>convert test.ai -define delegate:bimodal=true test.eps
convert.exe: `%s' (%d) "C:/Program Files/gs/gs9.02/bin/gswin32c.exe" -q -dQUIET -dPARANOIDSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dEPSCrop -sDEVICE=epswrite "-sOutputFile=C:/Users/ANDREA~1.KAR/AppData/Local/Temp/magick-Bd9zG7wI" -- "C:/Users/ANDREA~1.KAR/AppData/Local/Temp/magick-sm673r6u" @ error/utility.c/SystemCommand/1903.convert.exe: Delegate failed `"C:/Program Files/gs/gs9.02/bin/gswin32c.exe" -q -dQUIET -dPARANOIDSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dEPSCrop -sDEVICE=epswrite "-sOutputFile=%o" -- "%i"' @ error/delegate.c/InvokeDelegate/1058.
With -verbose:

Code: Select all

c:\tmp>convert -verbose test.ai -define delegate:bimodal=true test.eps
[ghostscript library] Files/gs/gs9.02/bin/gswin32c.exe" -q -dQUIET -dPARANOIDSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dEPSCrop -dAlignToPixels=0 -dGridFitTT=2 "-sDEVICE=pngalpha" -dTextAlphaBits=4 -dGraphicsAlphaBits=4 "-r72x72"  "-sOutputFile=C:/Users/ANDREA~1.KAR/AppData/Local/Temp/magick-QTJa8Vax-%08d" "-fC:/Users/ANDREA~1.KAR/AppData/Local/Temp/magick-EimLe1rB" "-fC:/Users/ANDREA~1.KAR/AppData/Local/Temp/magick-H_T4EIXy"
C:/Users/ANDREA~1.KAR/AppData/Local/Temp/magick-QTJa8Vax-00000001 PNG 842x595 842x595+0+0 8-bit DirectClass 5.02KB 0.000u 0:00.013 
test.ai PDF 842x595 842x595+0+0 16-bit DirectClass 5.02KB 0.000u 0:00.010
"C:/Program Files/gs/gs9.02/bin/gswin32c.exe" -q -dQUIET -dPARANOIDSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dEPSCrop -sDEVICE=epswrite "-sOutputFile=C:/Users/ANDREA~1.KAR/AppData/Local/Temp/magick-YEFpz6Dd" -- "C:/Users/ANDREA~1.KAR/AppData/Local/Temp/magick-H70kzhlc"
convert.exe: `%s' (%d) "C:/Program Files/gs/gs9.02/bin/gswin32c.exe" -q -dQUIET -dPARANOIDSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dEPSCrop -sDEVICE=epswrite "-sOutputFile=C:/Users/ANDREA~1.KAR/AppData/Local/Temp/magick-YEFpz6Dd" -- "C:/Users/ANDREA~1.KAR/AppData/Local/Temp/magick-H70kzhlc" @ error/utility.c/SystemCommand/1903.
convert.exe: Delegate failed `"C:/Program Files/gs/gs9.02/bin/gswin32c.exe" -q -dQUIET -dPARANOIDSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dEPSCrop -sDEVICE=epswrite "-sOutputFile=%o" -- "%i"' @ error/delegate.c/InvokeDelegate/1058.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: "Transcoding" delegates seem broken

Post by magick »

We can reproduce the problem you posted and will have a fix in the next point release of ImageMagick. Thanks.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: "Transcoding" delegates seem broken

Post by magick »

We spent a few hours and could not track down the source of this bug. Bimodal PS => EPS works fine under Linux but fails under Windows. It may be some time before we come up with a solution.
andreas.k
Posts: 3
Joined: 2011-11-23T04:55:51-07:00
Authentication code: 8675308

Re: "Transcoding" delegates seem broken

Post by andreas.k »

Ok, thanks anyway... If I get some time I'll try to help out and debug the problem.
Post Reply