Page 2 of 2

Re: 415 - Postscript Delegate Failed

Posted: 2008-05-06T09:02:41-07:00
by PCPete
Hi guys,

I have installed the latest build and have the latest GhostScript installed as well. My problem is that when handling a PDF, and trying to examine it's colorspace, I get the 415 error as well. I am using an ASPX page. All other files work such as tiff, jpeg, etc.

Code: Select all

Sub doMagic(ByVal fileInfo As Object)
        Dim objIm, imgPath, colorspace, xRes, yRes, dpiFlag, colorSpaceFlag
        dpiFlag = 0
        imgPath = fileInfo.fullName
        objIm = Server.CreateObject("ImageMagickObject.MagickImage.1")
        If Not objIm Is Nothing Then
            If fileInfo.extension.ToLower() <> ".pdf" Then
                colorspace = objIm.identify("-format", "%r", imgPath)
                If colorspace <> "DirectClassRGB" Or colorspace <> "DirectClassCMYK" Or colorspace <> "PsuedoClassGray" Then
                    Response.Write("The colorspace of this file is not supported. Please try a different file")
                End If
           
                'Get X & Y Density, it outputs as a string "72 PixelsPerInch" - Take the left 3 place and trim and compare.
                xRes = objIm.identify("-format", "%x", imgPath)
                yRes = objIm.identify("-format", "%y", imgPath)
            
                If Left(Trim(xRes), 3) < 300 Or Left(Trim(yRes), 3) < 300 Then
                    dpiFlag = 1
                End If
            
                Response.Write("<br/> Resolution is " & Left(Trim(xRes), 3) & "x" & Left(Trim(yRes), 3))
            
                If dpiFlag <> 1 Then
                    Response.Write("<br/>DPI Passes Hi resolution check")
                Else
                    Response.Write("<br/>The resolution is not sufficient")
                End If
            Else
                'HERE IS WHERE THE ERROR LIES
                colorspace = objIm.identify("-format", "%r", imgPath)
            End If
        End If
    End Sub
The pdf was simply an image i had saved as a pdf - there was nothing special about it. No transparency, no layers, etc. I have tried numerous PDFs all with the same result so I do not believe it is my file causing the problem. I had split out the PDF from the rest of the image processing so that I could attend to it differently, I used a Try / Catch to display the error to the browser and I got:

Code: Select all

System.Runtime.InteropServices.COMException (0x80041771): identity: 415: Postscript delegate failed `c:\inetpub\wwwroot\dedupePurls\lists\DoNotWant_PeeWee_300.pdf': No such file or directory: at Microsoft.VisualBasic.CompilerServices.LateBinding.LateGet(Object o, Type objType, String name, Object[] args, String[] paramnames, Boolean[] CopyBack) at Microsoft.VisualBasic.CompilerServices.NewLateBinding.LateGet(Object Instance, Type Type, String MemberName, Object[] Arguments, String[] ArgumentNames, Type[] TypeArguments, Boolean[] CopyBack) at ASP.dedupepurls_default_aspx.doMagic(Object fileInfo)
thanks for any assistance you can offer! Also, I am 100% positive the file exists exactly at the file path in the error wher eit says it does not.

Re: 415 - Postscript Delegate Failed

Posted: 2008-05-06T09:54:07-07:00
by magick
Set the environment variable MAGICK_DEBUG to 'all' and rerun your ASP script. Check the log and see if there is any insight into the problem. We're not Windows developers nor do we have an IIS server so we need to depend on the ImageMagick community to track this problem down...

Re: 415 - Postscript Delegate Failed

Posted: 2008-05-06T09:55:49-07:00
by magick
Try removing the PARNOIDSAFER define in the delegates.xml configuration file. See if that permits Ghostscript to run.

Re: 415 - Postscript Delegate Failed

Posted: 2008-05-06T11:54:40-07:00
by PCPete
Thanks for the replies - I confirmed that the -PARANOIDSAFER switch from the delegates.xml file doesn't help, in what file can I find MAGICK_DEBUG to turn that on?

thanks!

Re: 415 - Postscript Delegate Failed

Posted: 2008-05-06T12:31:51-07:00
by magick
The easiest way is to inject it into the command line. Add "-debug", "all" to your ASP parameters.

Re: 415 - Postscript Delegate Failed

Posted: 2008-05-06T12:43:01-07:00
by PCPete
magick wrote:The easiest way is to inject it into the command line. Add "-debug", "all" to your ASP parameters.
This doesn't appear to have any effect on the output. I'm leaning towards believing the imageMagick commands are not making use of GS.

Re: 415 - Postscript Delegate Failed

Posted: 2008-05-06T12:46:36-07:00
by magick
We assume gs works from the command line. Try
  • convert logo: logo.pdf
    convert logo.pdf logo.jpg
If that works, it means Ghostscript is only failing in ASP.

Re: 415 - Postscript Delegate Failed

Posted: 2008-05-06T13:02:52-07:00
by PCPete
magick wrote:We assume gs works from the command line. Try
  • convert logo: logo.pdf
    convert logo.pdf logo.jpg
If that works, it means Ghostscript is only failing in ASP.
You're correct, I should have tried that first. A simple convert works - Any ASP developers in the house? Haha, thanks for the pointers so far, I can certainly appreciate that you're all not windows guys. Perhaps a permissions problem then.