Permissions problems with files generated from IM/GS

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
jonkeegan

Permissions problems with files generated from IM/GS

Post by jonkeegan »

I'm running ImageMagick 6.3.0 and AFPL Ghostscript 8.54 on Mac OS X 10.4, and I'm trying to get Ghostscript working correctly with IM.

GS is installed and working, but there is some problem with the install, since the files it generates have the wrong permissions. The directory I am converting these to is set for 777, so isn't a prob with the directory. As a result, when I run the following IM command (which should use GS):

Code: Select all

convert 1.pdf 1.jpg
I get the following error:

Code: Select all

Error: /undefinedfilename in (/var/tmp/magick-AltCgcLT)
Operand stack:

Execution stack:
   %interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--   false   1   %stopped_push
Dictionary stack:
   --dict:1128/1686(ro)(G)--   --dict:0/20(G)--   --dict:70/200(L)--
Current allocation mode is local
Last OS error: 13
AFPL Ghostscript 8.54: Unrecoverable error, exit code 1
convert: unable to open image `/var/tmp/magick-fAn9bRGU': Permission denied.
convert: no decode delegate for this image format `/var/tmp/magick-fAn9bRGU'.
convert: Postscript delegate failed `1.pdf'.
convert: missing an image filename `1.jpg'.
[/color]

Seems to be unable to read/write to /var/tmp/ , but when I run this via sudo, it works...

For the record, there's no problem when i run:

Code: Select all

convert 1.jpg 1.gif
, and all other IM commands work fine...I've also tried rebuilding both IM and GS multiple times with various options, such as (for IM):

Code: Select all

sudo ./configure --enable-shared --with-modules=yes --prefix=/usr/local --enable-delegate-build
Any thoughts?

Thanks
-Jon Keegan
meatheadmike

Re: Permissions problems with files generated from IM/GS

Post by meatheadmike »

What about /var/tmp? How are your permissions set up there?
jonkeegan

Re: Permissions problems with files generated from IM/GS

Post by jonkeegan »

I tried changing those to 777 (guessing that's not recommended in general)...didn't work (I've since changed it back)...

Dunno if there is a place to set the location of the temp directory it will use...though IM doesnt have any temp directory problems...seems odd...
ridera

Re: Permissions problems with files generated from IM/GS

Post by ridera »

What happens if you try creating a test file in the same dir with your code.

e.g., I ways include a php touch(foo.txt) in my php scripts just prior to my IM command with a die on failure.
Post Reply