Page 1 of 1

No Decode for PS to image (html2ps generated Postscript)

Posted: 2006-12-23T07:26:25-07:00
by bizk
Hi all.
I am having problems converting a postscript file generated by html2ps into an image,
The postscript file decodes perfectly when I open it on my system manually as a pdf conversion and is exactly as expected.

I have built and installed ImageMagick 6.3.1 from source on Mac OSX 10.4.8 as a universal binary.

I have used the following commandline:
/path/to/convert -page 600x840 -quality 85 -geometry 600x800 /path/to/ps/file/1_1.ps /path/to/output/file/1_1_100.jpg


I received the following commandline feedback:
sh: line 1: gs: command not found
sh: line 1: gs: command not found
convert: no decode delegate for this image format `/path/to/ps/file/1_1.ps'.


What do I need to install or amend, I did not use any configure options other than the -prefix and -exec-prefix values.
Have I forgotten to configure something?
I have also run
identify -list format
and part of the information returned was:
PS PS rw+ PostScript
PS2* PS2 -w+ Level II PostScript
PS3* PS3 -w+ Level III PostScript

So I know the format is supported, or is html2ps writing ps2/3 data that is messing ImageMagick up?

Do I need Ghostscript to be installed? I intentionally did not install it as I'm preparing software for a minimally configured system!

I'm quite happy building in static linked libraries if needed, but what do I need to do to make progress?

Help, I'm stuck.

cheers

Biz

Posted: 2006-12-23T07:33:04-07:00
by magick
ImageMagick uses Ghostscript as a delegate program or library to interpret Postscript. Download/install Ghostscript and your command should work.

Posted: 2006-12-23T08:58:20-07:00
by bizk
Have compiled and installed ghostscript in a custom location.
How do I make ImageMagick aware of it when compiling, or do I pass the ghostscript path to imagemagick when using it?
I still can't get it working right!
I need imagemagick and ghostscript to not interfere with whatever setup the user has on their system and have installed them in a custom directory.
A hint with pseudocode for the configure script would be a godsend!
Any ideas?

cheers

Biz

Posted: 2006-12-23T11:08:43-07:00
by magick
ImageMagick reverts to the gs program when it does not bind the Ghostscript delegate library. You can specify the path of the gs program in the delegates.xml configuration file or simply include gs in your program execution path.

Improvement but still slight problem.

Posted: 2006-12-24T05:51:03-07:00
by bizk
Hi Magick
Thank you for that assistance, it has got me creating the jpeg files, so I know that part where it calls up ghostscript is working to some degree!
Unfortunately the images appear to be corrupt.
I have replicated the process in the terminal.
The terminal feedback I get is as follows:
GNU Ghostscript 7.05: Unrecoverable error, exit code 1
convert: unable to open module file `/Applications/DutyCrew/helpers/imagemagick/lib/ImageMagick-6.3.1/modules-Q16/coders/jpeg.la': No such file or directory.

I think I need to compile in jpeg support to imagemagick as the jpeg.la file truly does not exist.
Can it be done in source code, or do I need to do something more complex? I think now would be a good time to compile in png support!
I'm also having problems when I try and do the same with a .gif output and it threw a wobbly with the following error
GNU Ghostscript 7.05: Unrecoverable error, exit code 1
Error: /invalidfont in findfont

It was at least making the correctly sized gif images, which is a good proof of function for ImageMagick.
I think I have pretty well traced that fault down to ghostscript and font detection!
I think I need to follow that failure up with a good study of the ghostscript documentation. I am confused as to why it does not find my default system fonts (which is all it needs to do anyway!)
Time to rtfm (or at least the rest of the documentation!)
:roll: sheesh!

cheers

Biz