[SOLVED] trouble with postscript

StefanL

Joined: 2005-07-26
Posts: 16
Posted: Tue, 2005-07-26 11:45

Hello I am new to gallery2 and I must say it's fantastic.
Installation was so easy and the Script seems to run faster than other galleries. Really great job you all did!

But there is one problem, I can't get ImageMagick to work with postscript and pdf.
I know, that my ImageMagick installation is working, I can tried from command-line and it worked very well, but gallery2 won't work with application/postscript.
application/postscript isn't listed in supported mime-types hen I click the test button.

Gallery is installed on an local intranet webserver for building up a huge picture database. So I can't provide you with any URLs.

I hope you understand my damn bad english... :-?
----

Gallery URL (optional): --
Gallery version: 2.0 beta 4 (FLIPPIN' SWEET!)
Webserver (with version): Linux web 2.4.16
Datatabase (with version): MySQL 2.0.21
PHP version (eg 4.2.1): 4.3.9
phpinfo URL (optional): --
Graphics Toolkit(s): ImageMagick (Version 6.2.3 configured with gslib)
Operating system: w2k SP4
Web browser/version: IE 6.0/Opera
G1 version (for migration bugs): --

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Tue, 2005-07-26 11:51

for me, it's listed and it works.
application/postscript

possible reason that it doesn't work for you:
1. path issues. don't test it in the commandline with your root user, test it with the apache / webserver user,
test:
identify somePostscriptFile.ps
and
convert somePostscriptFile.ps foo.jpg

edit: usually it's because Ghostscript is not in the path of the webserver user. imagemagick uses Ghostscript to do this ps stuff.

 
StefanL

Joined: 2005-07-26
Posts: 16
Posted: Tue, 2005-07-26 12:09

thx valiant for your hints, but that's not the problem.
1. pathes are set correct, other php scripts are working correct with ImageMagick and gs.

2. I changed the user and tried again from commandline and it worked perfect, I could identify and convert the eps file I uploaded before.

Maybe it's the IM Version (6.2.3) ???

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Tue, 2005-07-26 12:15

please activate buffered debug mode and then go to site admin -> imagemagick and click test.
then either debug on your own or post the output here.

 
StefanL

Joined: 2005-07-26
Posts: 16
Posted: Tue, 2005-07-26 12:55

thx for your support!
I will try that now...

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Tue, 2005-07-26 12:59

i forgot: you have to change a line in config.php to activate the buffered debug mode, it's explained in config.php.

 
StefanL

Joined: 2005-07-26
Posts: 16
Posted: Tue, 2005-07-26 13:59

thx found it...

that's the interesting part of the output from debug:

Executing: ( "/usr/local/bin/identify" "/opt/lampp/htdocs/gallery2/modules/imagemagick/classes/../test/data/test.eps" ) 2>/opt/lampp/htdocs/gallery2/g2data/tmp/g2dbglTuPpF file_exists(/opt/lampp/htdocs/gallery2/g2data/tmp/g2dbglTuPpF) filesize(/opt/lampp/htdocs/gallery2/g2data/tmp/g2dbglTuPpF) fopen(/opt/lampp/htdocs/gallery2/g2data/tmp/g2dbglTuPpF, r, 0) feof(Resource id #110) fgets(Resource id #110, 4096) feof(Resource id #110) fgets(Resource id #110, 4096) feof(Resource id #110) fgets(Resource id #110, 4096) feof(Resource id #110) fgets(Resource id #110, 4096) feof(Resource id #110) fclose(Resource id #110) unlink(/opt/lampp/htdocs/gallery2/g2data/tmp/g2dbglTuPpF) Regular Output: Error Output: sh: gs: command not found sh: gs: command not found identify: no decode delegate for this image format `/opt/lampp/htdocs/gallery2/modules/imagemagick/classes/../test/data/test.eps'. Status: 1 (expected 0)

seems to me IM isn't build within the gslib, is that right?

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Tue, 2005-07-26 14:08

nope, when you say it works for you in the command line (identify somefile.eps / identify somefile.ps), then it means gs is not in path for your webserver user.

 
StefanL

Joined: 2005-07-26
Posts: 16
Posted: Tue, 2005-07-26 14:10

ok, that helps...
But I am a Linux n00b, so I got to ask, how can I change this?

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Tue, 2005-07-26 14:17

google it. honestly, i google all the time for stuff i don't know.

i guess you want to add /usr/bin to the path in httpd.conf

http://www.google.com/search?hl=en&lr=&c2coff=1&q=httpd.conf+env+path&btnG=Search

 
StefanL

Joined: 2005-07-26
Posts: 16
Posted: Tue, 2005-07-26 14:52

ok, I googled alot, read alot, but didn't find anything, that's wrong with my configuration.
I installed gs and IM as root on the server using ssh.
IM itself seems to work correctly, I am out of ideas for now and will go on tomorrow.
Thanks for your fast help!

 
StefanL

Joined: 2005-07-26
Posts: 16
Posted: Wed, 2005-07-27 07:41

Hello again, I tried and tried but can't get IM to work with eps from script.
The pathes seem to be correct, has anybody another idea?

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Wed, 2005-07-27 07:56

did you say it worked from other php scripts on the same webserver?

 
StefanL

Joined: 2005-07-26
Posts: 16
Posted: Wed, 2005-07-27 08:54
valiant wrote:
did you say it worked from other php scripts on the same webserver?

I did some tests this morning and found out, that it doesn't work from other scripts too. Now its not a gallery2 problem, seems to be a GS problem. I will try to reinstall gs and IM now.
If that doesn't work I'm going to buy a grenade and blow the webserver into the galaxy. :lol:

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Wed, 2005-07-27 09:06

nope. it's not a im or gs problem.
you said it works from the command line with your root user.
it's obviously a paths problem.

 
StefanL

Joined: 2005-07-26
Posts: 16
Posted: Wed, 2005-07-27 09:21

I read Zürich is your location, do you speak german?
Would be much easier for me.
Where can I find the path settings of IM and GS?
Or do you mean PATH env settings of the system the server is running on?
When I log in as root and su to nobody (which is the user apache is running on) I can identify and convert from command line too.

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Wed, 2005-07-27 09:24

i mean the PATH env and yes, i speak german. but your english is good and we try to keep everything in the official forum language.

as to your su nobody attempt: i had this PATH issues too once. i tried to install oracle and couldn't figure out why it complained / didn't work. i've even added the correct path to the PATH env variable in the httpd.conf etc.
it wasn't too important for me, so i gave up.

 
StefanL

Joined: 2005-07-26
Posts: 16
Posted: Wed, 2005-07-27 11:08

THX for your help i figured out how to get it to work now.
Here comes the trick:

there is a file named delegates.xml containing the commands IM uses to handle the different filetypes. I found some lines that call gs and changed this pathes.
For examole:
original:
<delegate decode="eps" encode="pdf" mode="bi" command='"gs" -q -dBATCH -dSAFER -dMaxBitmap=500000000 -dNOPAUSE -dAlignToPixels=0 -sDEVICE="pdfwrite" -sOutputFile="%o" -f"%i"' />

changed line:
<delegate decode="eps" encode="pdf" mode="bi" command='"/usr/local/bin/gs" -q -dBATCH -dSAFER -dMaxBitmap=500000000 -dNOPAUSE -dAlignToPixels=0 -sDEVICE="pdfwrite" -sOutputFile="%o" -f"%i"' />

notice the '/usr/local/bin/' in front of gs!

that did the trick.

Hope this is helpful for other people having trouble with that sh...

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Wed, 2005-07-27 11:09

that's cheating :)

marking the topic as solved.