3

I am testing my file conversions on the test server and I got this error below. I tested the case on my local and it worked without a problem. On the server it gives me some trouble.

FailedToExecuteCommand `"gswin32c.exe" -q -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 "-sDEVICE=pngalpha" -dTextAlphaBits=4 -dGraphicsAlphaBits=4 "-r72x72" -g350x350 -dEPSCrop "-sOutputFile=C:/Windows/TEMP/magick-1520z9_ZtBD3O2dg%d" "-fC:/Windows/TEMP/magick-15203XcyD8hja0LJ" "-fC:/Windows/TEMP/magick-1520fnhOiV0JVLNJ"' (Le fichier spécifié est introuvable.) @ error/delegate.c/ExternalDelegateCommand/475.convert:

Any help/tips would be greatly appreciated.

EDIT 2:

I also find a link where the imagemagick admin suggests to change the gs path in the delegates.xml. This solution looks promising but the delegate file has one entry for eps to ps conversions as below:

<delegate decode="eps" encode="ps" mode="bi" command="&quot;@PSDelegate@&quot; -q -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 -sDEVICE=ps2write &quot;-sOutputFile=%o&quot; -- &quot;%i&quot;"/>

And I can't seem to find how imagemagick refers to the GS location. I added gs to the path variable and/or modified the delegates.xml with the location to fix this.

EDIT 3:

I have a error "no images defined" from the imagemagick convert command as below. Do I need to set up some permissions for gs because I don't find the temporary folders in the Temp directory.These seems to work magically on my local, but hesitates to function on the test server.

convert: Postscript delegate failed [ghostscript library 9.22] -q -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 "-sDEVICE=pngalpha" -dTextAlphaBits=4 -dGraphicsAlphaBits=4 "-r72x72" -g350x350 -dEPSCrop "-sOutputFile=C:/Windows/TEMP/magick-110207SjtG6NIBllO%d" "-fC:/Windows/TEMP/magick-1102057mSI5SPZ919" "-fC:/Windows/TEMP/magick-11020HeIOX7qThedE" -c showpage: (null)' @ error/ps.c/ReadPSImage/884.convert: no images definedD:\inetpub\IndependenceAWS\Conversion_DEV_DCHI\78\20190208-121606-797-QSAX2N0OVB\JPG\icam_logo_ToJPG.JPG' @ error/convert.c/ConvertImageCommand/3300

KenS
  • 27,930
  • 2
  • 31
  • 42
Binoy Cherian
  • 314
  • 1
  • 4
  • 19
  • You could find the name and path of your 64-bit ghostscript executable and edit that into the `delegates.xml` file of **ImageMagick**. – Mark Setchell Feb 11 '19 at 09:52
  • @MarkSetchell, thanks, That worked. I have a new problem. I am going to edit my post with the new problem – Binoy Cherian Feb 11 '19 at 10:11
  • I'm confused, should I ask a new question for edit3 – Binoy Cherian Feb 11 '19 at 10:42
  • What is the command you are running? – Bonzo Feb 11 '19 at 12:18
  • @Bonzo: for the problem in edit 3, convert C:\\Conversion\\_DEV_DCHI\\78\\20190208-121606-797-QSAX2N0OVB\\icam_logo.eps -quality 100 -density 150 C:\\Conversion\\_DEV_DCHI\\78\\20190208-121606-797-QSAX2N0OVB\\JPG\\icam_logo_ToJPG.JPG – Binoy Cherian Feb 11 '19 at 12:20
  • It works well in my local :( – Binoy Cherian Feb 11 '19 at 12:21
  • Why have you hidden the part I need to see? What is `[ghostscript library 9.22]`? – Mark Setchell Feb 11 '19 at 16:49
  • See https://stackoverflow.com/questions/52861946/imagemagick-not-authorized-to-convert-pdf-to-an-image/52863413#52863413 about editing your policy.xml file to give permission to process PDF file – fmw42 Feb 11 '19 at 19:04
  • @MarkSetchell, I haven't hidden it. That's the result from the error stream when I execute the command. This is how my delegate looks like " – Binoy Cherian Feb 12 '19 at 10:20
  • @fmw42, I added the new policy(it didn't exist the xml before) that still gives the same error output. I installed ghostcsript 9.26 x64 and tested, but no luck – Binoy Cherian Feb 12 '19 at 10:21
  • Are you using Imagick on the server or just Imagemagick. If the former, you may need to provide the full path to Ghostscript (gs) in the delegates.xml file for all the PS encodes. – fmw42 Feb 12 '19 at 22:25
  • @fmw42, I'm using it on the server. I will try to pass the full path and update you with my results. Thank you so much for your time. – Binoy Cherian Feb 14 '19 at 09:47
  • In what directory did you do that? See https://imagemagick.org/script/resources.php – fmw42 Feb 14 '19 at 16:58
  • @fmw42 : C:\Program Files\ImageMagick-7.0.8-Q16, this is the location where I modified the xml's policy.xml and the delegate.xml – Binoy Cherian Feb 15 '19 at 14:15
  • Sorry, in Unix it that would not be the correct location. I am not a Windows user, so do not know where to suggest other than the link I posted above. – fmw42 Feb 15 '19 at 18:39
  • @fmw42; I found something on the imagemagick website, https://www.imagemagick.org/discourse-server/viewtopic.php?t=24757, Namari has posted a solution, Imagemagick uses the C:\Windows\Temp. I was hoping to understand if you knew some method by which I could replace the C:\Windows\Temp by an another folder on the D drive – Binoy Cherian Feb 18 '19 at 14:09
  • See Magick_Temporary_Path at https://imagemagick.org/script/resources.php#environment. I don't know Windows nor if it will work cross volumes. – fmw42 Feb 18 '19 at 18:07

3 Answers3

4

For the first problem,

FailedToExecuteCommand `"gswin32c.exe"

Configure the path of the ghostscript bin folder on the system variables and/or configure the delegates.xml which can be found in the folder path C:\Program Files\ImageMagick-7.0.8-Q16

Modify the delegate as below:

delegate decode="eps" encode="ps" mode="bi" command=""C:\Program Files\gs\gs9.26\bin\gswin64.exe@" -q -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 -sDEVICE=ps2write "-sOutputFile=%o" -- "%i""

For the second problem where Imagemagick has problems to access the Temp folder of the C drive.

Add or uncomment the policy for the temporary file path as below

policy domain="resource" name="temporary-path" value="D:/inetpub/IndependenceAWS/Conversion-Temp"/

Another edit in the same xml as below solves the problems and allows imagemagick to use the new folder for temporary conversions

policy domain="module" rights="read|write" pattern="{PS,PDF,XPS}"

A great thanks to all the people who have commented on my question and helped me solve these issues.

Binoy Cherian
  • 314
  • 1
  • 4
  • 19
1

You need to install ghostscript.

You can download it here and install it and the error goes away.

For example, download the 64bit version, and double click it and go by its installation instructions. Then rerun your magick command, the FailedToExecuteCommand "gswin32c.exe" error will go away.

Note: as a comment mentioned: GS 9.26 has some bugs -- try downgrading to 9.23, 9.24 or 9.25. 3, using 9.27 produces neither errors nor output, but after changing to 9.24, all things are fine.

Hustlion
  • 1,535
  • 13
  • 19
1

If anyone is having this issue with the MSYS2 build of ImageMagick, you need to install GhostScript through MSYS2: run either of:

  • on MSYS2 MinGW 64 bits: pacman -S mingw-w64-x86_64-ghostscript
  • on MSYS2 MinGW 32 bits: pacman -S mingw-w64-i686-ghostscript
Delthas
  • 81
  • 1
  • 8