This project has moved. For the latest updates, please go here.

Postscript delegate failed - No such file or directory @ error/pdf.c/ReadPDFImage/682

Mar 7, 2014 at 9:59 AM
Edited Mar 7, 2014 at 10:00 AM
Hi everyone.

I've got the following error when trying to open .ai images:

ERROR 2014-03-07 10:53:14,812 [6] Logic.clsMaqueta - ImageMagick.MagickDelegateErrorException: Magick: Postscript delegate failed `\sesdesboa01\datos$\Tratamiento Imagenes NETEX\Proceso\Original completo NO JPG\Links\630928.ai': No such file or directory @ error/pdf.c/ReadPDFImage/682
at ImageMagick.MagickImageCollection.HandleReadException(MagickException exception)
at ImageMagick.MagickImageCollection.Read(String fileName, MagickReadSettings readSettings)
at ImageMagick.MagickImageCollection..ctor(String fileName)
at Logic.clsMagickImageUtils.ImagenCMYK2RGB(Boolean magickLogDebugInfo, String magickTemporaryDir, UInt64 magickMemoryLimit, FileInfo inputImage, String outputImageFullName, ColorProfile colorProfile, String customColorProfileName, String customColorProfileFile, String resolucion, String size, MagickFormat formatoSalida, Boolean hasClipMask, Boolean hasLayers)
at Logic.clsMaqueta.processImageSize(FileInfo imagen, String salidaFolder, String size, Boolean hasClipMask, Boolean hasLayers)


I'm using Magick.net in a Windows service that runs on a Windows Server 2003 32 Bits.

I have double checked that Ghostscript 32 Bits version is installed. I have even uninstalled, run CCleaner and reinstalled. Presently, and it should be the final configuration, it is not installed in C:, but in another unit. I have tried uninstalling and installing in C:, but without success.

The user logon of the service has enough privileges to run both, the service and ghostscript.

The same configuration of the service, in my local station works well. The main difference is that it is a 64 Bits Windows 7, but I'm using the same user in both machines.

If any of you can help, you'll be welcome.

Thanks.
Coordinator
Mar 7, 2014 at 10:55 AM
Edited Mar 7, 2014 at 11:14 AM
Did you install Ghostscript in a path that contains special characters? And did you install that latest version?

Can you try to see if you get more information when you enable debugging? https://magick.codeplex.com/wikipage?title=Detailed%20debug%20information&referringTitle=Documentation
Mar 7, 2014 at 11:26 AM
Hi dlemstra,

Ghostscript is installed in the default folder, but changing the unti. That is

E:\Program Files\gs\gs9.10

Presently I do have debug enabled, and I get the following log.
I've bolded the errors.

I'm trying to find what "Ghostscript returns status -100, exit code 0" means.

The .ai images that I'm trying to convert do exist.

INFO 2014-03-07 13:08:16,138 [6] Logic.clsMagickImageUtils - Habilitado el log de informaci󮠤e Debug de Magick.Net
INFO 2014-03-07 13:08:16,138 [6] Logic.clsMagickImageUtils - Magick temporary dir : \sesdesboa01\f$\Temp\Magick
INFO 2014-03-07 13:08:16,138 [6] Logic.clsMagickImageUtils - Magick memory limit : 1073741824
DEBUG 2014-03-07 13:08:16,138 [6] Logic.clsMagickImageUtils - Magick.net debug info -->2014-03-07T13:08:16+01:00 0:00.015 0.016u 6.8.8 Policy Magick[5732]: policy.c/IsRightsAuthorized/485/Policy
Domain: Path; rights=Read; pattern="\sesdesboa01\datos$\Tratamiento Imagenes NETEX\Proceso\Original completo NO JPG\Links\630928.ai" ...
DEBUG 2014-03-07 13:08:16,138 [6] Logic.clsMagickImageUtils - Magick.net debug info -->2014-03-07T13:08:16+01:00 0:00.015 0.016u 6.8.8 Blob Magick[5732]: blob.c/OpenBlob/2536/Blob
read 3 magic header bytes
DEBUG 2014-03-07 13:08:16,138 [6] Logic.clsMagickImageUtils - Magick.net debug info -->2014-03-07T13:08:16+01:00 0:00.015 0.016u 6.8.8 Cache Magick[5732]: cache.c/DestroyPixelCache/961/Cache
destroy
DEBUG 2014-03-07 13:08:16,154 [6] Logic.clsMagickImageUtils - Magick.net debug info -->2014-03-07T13:08:16+01:00 0:00.031 0.031u 6.8.8 Policy Magick[5732]: policy.c/IsRightsAuthorized/485/Policy
Domain: Coder; rights=Read; pattern="PDF" ...
DEBUG 2014-03-07 13:08:16,154 [6] Logic.clsMagickImageUtils - Magick.net debug info -->2014-03-07T13:08:16+01:00 0:00.031 0.031u 6.8.8 Policy Magick[5732]: policy.c/IsRightsAuthorized/485/Policy
Domain: Path; rights=Read; pattern="\sesdesboa01\datos$\Tratamiento Imagenes NETEX\Proceso\Original completo NO JPG\Links\630928.ai" ...
DEBUG 2014-03-07 13:08:16,154 [6] Logic.clsMagickImageUtils - Magick.net debug info -->2014-03-07T13:08:16+01:00 0:00.031 0.031u 6.8.8 Blob Magick[5732]: blob.c/OpenBlob/2536/Blob
read 3 magic header bytes
DEBUG 2014-03-07 13:08:16,154 [6] Logic.clsMagickImageUtils - Magick.net debug info -->2014-03-07T13:08:16+01:00 0:00.031 0.031u 6.8.8 Cache Magick[5732]: cache.c/DestroyPixelCache/961/Cache
destroy
DEBUG 2014-03-07 13:08:16,154 [6] Logic.clsMagickImageUtils - Magick.net debug info -->2014-03-07T13:08:16+01:00 0:00.031 0.031u 6.8.8 Policy Magick[5732]: policy.c/IsRightsAuthorized/485/Policy
Domain: Path; rights=Read; pattern="\sesdesboa01\datos$\Tratamiento Imagenes NETEX\Proceso\Original completo NO JPG\Links\630928.ai" ...
DEBUG 2014-03-07 13:08:16,154 [6] Logic.clsMagickImageUtils - Magick.net debug info -->2014-03-07T13:08:16+01:00 0:00.031 0.031u 6.8.8 Blob Magick[5732]: blob.c/OpenBlob/2536/Blob
read 3 magic header bytes
DEBUG 2014-03-07 13:08:20,232 [6] Logic.clsMagickImageUtils - Magick.net debug info -->2014-03-07T13:08:20+01:00 0:04.109 3.813u 6.8.8 Exception Magick[5732]: pdf.c/InvokePDFDelegate/205/Exception
%s': %s "E:/Program Files/gs/gs9.10/bin/gswin32c.exe" -q -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 "-sDEVICE=pamcmyk32" -dTextAlphaBits=4 -dGraphicsAlphaBits=4 "-r72x72" -dUseCIEColor "-sOutputFile=//sesdesboa01/f$/Temp/Magick/magick-5732vI-u3Ctln_ZP76142608" "-f//sesdesboa01/f$/Temp/Magick/magick-5732yxO95GapwyHD" "-f//sesdesboa01/f$/Temp/Magick/magick-5732shcu3C1X4V6n"
__DEBUG 2014-03-07 13:08:20,232 [6] Logic.clsMagickImageUtils - Magick.net debug info -->2014-03-07T13:08:20+01:00 0:04.109 3.813u 6.8.8 Coder Magick[5732]: pdf.c/InvokePDFDelegate/208/Coder
Ghostscript returns status -100, exit code 0
____DEBUG 2014-03-07 13:08:20,232 [6] Logic.clsMagickImageUtils - Magick.net debug info -->2014-03-07T13:08:20+01:00 0:04.109 3.813u 6.8.8 Exception Magick[5732]: pdf.c/ReadPDFImage/682/Exception
Postscript delegate failed
\sesdesboa01\datos$\Tratamiento Imagenes NETEX\Proceso\Original completo NO JPG\Links\630928.ai': No such file or directory
__DEBUG 2014-03-07 13:08:20,232 [6] Logic.clsMagickImageUtils - Magick.net debug info -->2014-03-07T13:08:20+01:00 0:04.109 3.813u 6.8.8 Cache Magick[5732]: cache.c/DestroyPixelCache/961/Cache
destroy
DEBUG 2014-03-07 13:08:20,232 [6] Logic.clsMagickImageUtils - Magick.net debug info -->2014-03-07T13:08:20+01:00 0:04.109 3.813u 6.8.8 Cache Magick[5732]: cache.c/DestroyPixelCache/961/Cache
destroy
__ERROR 2014-03-07 13:08:20,232 [6] Logic.clsMagickImageUtils - ImageMagick.MagickDelegateErrorException: Magick: Postscript delegate failed \\sesdesboa01\datos$\Tratamiento Imagenes NETEX\Proceso\Original completo NO JPG\Links\630928.ai': No such file or directory @ error/pdf.c/ReadPDFImage/682
at ImageMagick.MagickImage.HandleReadException(MagickException exception)
at ImageMagick.MagickImage.Read(String fileName)
at Logic.clsMagickImageUtils.ImagenCMYK2RGB(Boolean magickLogDebugInfo, String magickTemporaryDir, UInt64 magickMemoryLimit, FileInfo inputImage, String outputImageFullName, ColorProfile colorProfile, String customColorProfileName, String customColorProfileFile, String resolucion, String size, MagickFormat formatoSalida, Boolean hasClipMask, Boolean hasLayers)
ERROR 2014-03-07 13:08:20,232 [6] Logic.clsMaqueta - ImageMagick.MagickDelegateErrorException: Magick: Postscript delegate failed
\sesdesboa01\datos$\Tratamiento Imagenes NETEX\Proceso\Original completo NO JPG\Links\630928.ai': No such file or directory @ error/pdf.c/ReadPDFImage/682
at ImageMagick.MagickImage.HandleReadException(MagickException exception)
at ImageMagick.MagickImage.Read(String fileName)
at Logic.clsMagickImageUtils.ImagenCMYK2RGB(Boolean magickLogDebugInfo, String magickTemporaryDir, UInt64 magickMemoryLimit, FileInfo inputImage, String outputImageFullName, ColorProfile colorProfile, String customColorProfileName, String customColorProfileFile, String resolucion, String size, MagickFormat formatoSalida, Boolean hasClipMask, Boolean hasLayers)
at Logic.clsMaqueta.processImageSize(FileInfo imagen, String salidaFolder, String size, Boolean hasClipMask, Boolean hasLayers)
__
Mar 7, 2014 at 11:30 AM
Should I define a postscript printer in the server?
Coordinator
Mar 7, 2014 at 12:13 PM
You don't need to do that. Can you add a link to your file or contact me through CodePlex if you don't want to publicly share your image.
Mar 7, 2014 at 12:34 PM
I'll do it if the testing I'm carrying on fails.
Mar 7, 2014 at 1:29 PM
Edited Mar 7, 2014 at 1:30 PM
Well.

It has to be with the parameters of Magick.net.

Do you remember the post Magick net parameters?

I followed your suggestion and I'have included this piece of code when I use Magick.Net:
  if (magickLogDebugInfo)
  {
                    MagickNET.SetLogEvents(LogEvents.All);
                    MagickNET.Log += MagickNET_Log;

                    Logger.Info("Habilitado el log de información de Debug de Magick.Net");
  }

  if (!string.IsNullOrEmpty(magickTemporaryDir))
  {
                    MagickNET.SetTempDirectory(magickTemporaryDir);

                    Logger.Info("Magick temporary dir : " + magickTemporaryDir);
  }
  else
  {
                    Logger.Info("Magick temporary dir : por defecto");
  }

  if (magickMemoryLimit > 0)
  {
                    ImageMagick.ResourceLimits.Memory = magickMemoryLimit;

                    Logger.Info("Magick memory limit : " + magickMemoryLimit.ToString());
  }
  else
  {
                    Logger.Info("Magick memory limit : por defecto");
  }
Basically, I check for non null/non empty parameters to either use then or the defaults.

The problems that are the origin of this post happens when I run my code with parameters having some values, all of them.

But if I make then null, empty or zero respectivelly, and I create the environment variables as I pointed in "Magick net parameters", then I've got NO problem with Gostscript.

Is it that I'm missing some configuration or perhaps I'm doing something wrong?

Thanks!!
Coordinator
Mar 7, 2014 at 1:34 PM
Edited Mar 7, 2014 at 1:40 PM
Can you check if it works if you do not call MagickNET.SetTempDirectory? I think setting the temp directory is causing the problem. Did you set it to a network share?
Mar 10, 2014 at 8:43 AM
Hello there.

I have checked it out and it works if I don not call de MagickNET.SetTempDirectory method.

I'm moving to another project, so it willl de difficult to make further tests.

Hope it helps.

Thank you.
Coordinator
Mar 10, 2014 at 10:07 AM
I made a fix to ImageMagick this weekend that should resolve the issue when you use a network share as a temporary directory. Feel free to try the next release if the other project also does not meet your needs.