Sometimes when PDF files are uploaded the graphical processing of them fails and messages like this are logged:
2012/09/10 16:39:58:776 IST [WARN] ImageAssetManagerImpl - FileAssetManagerImpl.storeTempUploadedFile: error generating preview <com.bright.framework.image.exception.ImageException: ImageMagick.execute: C:/Program Files/ImageMagick/identify -format %w-@-%h-@-%r-@- -define pdf:use-cropbox=true e:\assets/2/Medway_Mail_Centre5.pdf : Returned code: 1,error output: Magick: `%s' (%d) "gswin32c.exe" -q -dQUIET -dPARANOIDSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dEPSCrop -dAlignToPixels=0 -dGridFitTT=2 "-sDEVICE=pnmraw" -dTextAlphaBits=4 -dGraphicsAlphaBits=4 "-r72x72" -dUseCropBox "-sOutputFile=C:/Windows/TEMP/magick-iRZK8Fal" "-fC:/Windows/TEMP/magick-oj0o84mN" "-fC:/Windows/TEMP/magick-pqVex7QD" @ error/utility.c/SystemCommand/2093. Magick: Postscript delegate failed `e:\assets/2/Medway_Mail_Centre5.pdf': No such file or directory @ error/pdf.c/ReadPDFImage/645.>com.bright.framework.image.exception.ImageException: ImageMagick.execute: C:/Program Files/ImageMagick/identify -format %w-@-%h-@-%r-@- -define pdf:use-cropbox=true e:\assets/2/Medway_Mail_Centre5.pdf : Returned code: 1, error output: Magick: `%s' (%d) "gswin32c.exe" -q -dQUIET -dPARANOIDSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dEPSCrop -dAlignToPixels=0 -dGridFitTT=2 "-sDEVICE=pnmraw" -dTextAlphaBits=4 -dGraphicsAlphaBits=4 "-r72x72" -dUseCropBox "-sOutputFile=C:/Windows/TEMP/magick-iRZK8Fal" "-fC:/Windows/TEMP/magick-oj0o84mN" "-fC:/Windows/TEMP/magick-pqVex7QD" @ error/utility.c/SystemCommand/2093. Magick: Postscript delegate failed `e:\assets/2/Medway_Mail_Centre5.pdf': No such file or directory @ error/pdf.c/ReadPDFImage/645. at com.bright.framework.image.util.ImageMagick.execute(ImageMagick.java:549)
Usually, the reason for these errors is that Ghostscript is not on the PATH. In this situation copying the command from the logs, in this case "C:/Program Files/ImageMagick/identify -format %w-@-%h-@-%r-@- -define pdf:use-cropbox=true e:\assets/2/Medway_Mail_Centre5.pdf"and pasting it into a command prompt window results in the same error. The fix in that case is to add Ghostscript to the PATH, as per the installation instructions.
However, sometimes on 64 bit Windows the command works when pasted into a command prompt even though it doesn't work when run by Asset Bank (i.e. inside a Tomcat service). We are still working on a full explanation for this but it seems to have something to do with 64 Windows's registry redirection (WoW 64 32). This problem can be worked around by copying the contents of the registry key at HKEY_LOCAL_MACHINE\SOFTWARE\GPL Ghostscript to HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\GPL Ghostscript.
Comments
0 comments
Please sign in to leave a comment.