Page 1 of 1

Temporary file permission problem with convert

Posted: 2007-06-20T05:45:36-07:00
by mbnewmedia
I am calling the ImageMagickObject from an ASP program as follows:

Set objIM = CreateObject("ImageMagickObject.MagickImage.1")
sFilename = "G:\Mike\PhotoShop\pages\CD-2007-06-14-A01-ASection.pdf"
sJpgFilename = "G:\Mike\PhotoShop\pages\CD-2007-06-14-A01-ASection.jpg"
sResult = objIM.Convert(sFilename, "-resize", "x500", sJpgFilename)

and I get the following error:

convert: 430: unable to create temporary file `G:\Mike\PhotoShop\pages\CD-2007-06-14-A01-ASection.pdf': Permission denied:
convert: 410: missing an image filename `G:\Mike\PhotoShop\medium\CD-2007-06-14-A01-ASection.jpg':

The program does have R/W access to G:\Mike\PhotoShop\pages\. Is ImageMagick writing temporary file(s) to some other work folder?

Re: Temporary file permission problem with convert

Posted: 2007-06-20T10:42:50-07:00
by mbnewmedia
:D I found the solution to this. ImageMagick was using the default TMP system variable, and th eprogram could not write to that folder. I put in a new system variable for MAGICK_TMPDIR, pointed to a writeable folder, and this overrides the TMP variable. Works like a champ now.

Re: Temporary file permission problem with convert

Posted: 2007-08-08T14:49:47-07:00
by hina
Hello mbnewmedia,

I get exactly the same error message:
convert: 430: unable to create temporary file 'xyz.pdf': Permission denied:
convert: 410: missing an image filename `xys1.jpg'

I am able to convert the file from command prompt, but it gives me the above error messsage in asp code.

How were you able to solve it??? I have no clue about TMP system variable,MAGICK_TMPDIR.........

Please help!!!!! Other team/modules are dependant on my completion of this code.

Thanks,

Re: Temporary file permission problem with convert

Posted: 2007-08-09T06:03:26-07:00
by mbnewmedia
Your case may be differnet than mine, but for me, my asp program ran from a Windows web server and ImageMagick needs to use a temporary folder to write out a work file. My asp program did not have write permission to the default system TMP folder, which was like E:/temp I think.

So, you can set ImageMagicks TMP folder.

Log into the server as administrator.

Create temporary work folder E:\inetpub\wwwroot\work

Right click My Computer.
Click Properties.
Advanced tab.
Click Environment Variables.
Under System variables click New.
Enter:
Variable name: MAGICK_TMPDIR
Variable value: E:\inetpub\wwwroot\work
OK

This in effect set ImageMagick to use the new temporary work folder for its temporary files, and the asp program has write privileges to wwwroot/work.

Re: Temporary file permission problem with convert

Posted: 2007-08-13T13:41:25-07:00
by hina
Thanks a lot. It worked!!!!