0

Hello fellow Stackers,

Currently I am working on a website which requires the ability to handle, manipulate, create and save PostScript encoded files. Research on the topic pointed me towards two PHP classes called Imagick and MagickWand – both of which use Image Magick, which in turn depends on Ghostscript. Unfortunately the GD PHP class is not up to the task. I am performing the installation processes on a server running GNU/Linux via SSH from my Mac with OS X 10.9.1. Any help would be much appreciated. If any other details are needed, please inform me and I will do my absolute best to provide them.

Thus far, I have managed to make Image Magick and Ghostscript function independently – while simultaneously installed on the same system. However I was not able to install Ghostscript accordingly for it to function as an Image Magick delegate. From Terminal I was able to run the convert and gs commands successfully. At the time I was able to use the Imagick PHP class to perform the required tasks – such as detecting Color Space – on rasterised images.

As it stands Image Magick has been uninstalled from the server. I was not able to uninstall Ghostscript correctly. So my first question is: how on earth do I uninstall Ghostscript 9.10? It seems Ghostscript does not include an uninstall in its Makefile, ie: make uninstall returns make: *** No rule to make target 'uninstall'. Stop..

I have done some research and it seems that I should have compiled the Ghostscript shared library first: http://www.linuxfromscratch.org/blfs/view/svn/pst/gs.html Naturally I attempted to perform the steps in the article on Linux from Scratch. I have removed expat, freetype, lcms2, jpeg and libpng. I have performed ./configure with the suggested commands. I have also performed make and make so, both of which fail and exit, returning:
pngrutil.c:(.text+0x3cb): undefined reference to 'inflateReset2'
collect2: ld returned 1 exit status
make: *** [bin/gs] Error 1. edit: I have since narrowed this down to be related to Zlib.

I am looking for either an alternative to Imagick and MagickWand (which I was not able to find), insights into what is going wrong during the installation process or what might be done to resolve the current error.

Thank you all in advance.

Freddy
  • 1
  • 3
  • Stackoverflow is about asking programming problems, not about installing software. Please read http://stackoverflow.com/help/on-topic – Metalskin Jan 21 '14 at 00:02
  • Thank you for your input Metalskin. You may rest assure that this is a programming question at heart. Nevertheless, I will attempt to rephrase and expand upon my questions to be less specific to the installation process. I arrived at this point as a result of a programming problem: the need to encode and decode Postscript using PHP. The research on that topic lead me to – and only to – a PHP class by the name of Imagick, calling upon Image Magick with Ghostscript as a delegate. If there are any alternatives I would absolutely love to know. – Freddy Jan 21 '14 at 00:28
  • No worries. You might want to look at http://stackoverflow.com/questions/1439950/whats-the-opposite-of-make-install-ie-how-do-you-uninstall-a-library-in-lin I'm not 100% certain if it will solve your problem, but it may. – Metalskin Jan 21 '14 at 00:40
  • Thank you, I had indeed seen this thread, too. I was hoping to avoid the manual uninstallation. However, I did just run the command and the process seems quite manageable. – Freddy Jan 21 '14 at 00:59
  • I've added an answer as due to your reputation, you will not be able to answer yourself. – Metalskin Jan 21 '14 at 01:11

2 Answers2

0

A manual process to uninstall may be required if there is no uninstall defined for the makefile.

This has been discussed in the question What's the opposite of 'make install', ie. how do you uninstall a library in Linux?.

Community
  • 1
  • 1
Metalskin
  • 3,998
  • 5
  • 37
  • 61
0

I ditched the idea of using Ghostscript as an Image Magick Delegate, not only because the installation process was not working out for but, but also due to the fact that my research taught me that Image Magick rasterises all input files.

Instead I used the PHP exec() function to directly execute Ghostscript.

Freddy
  • 1
  • 3