Hand-configuring Environmental variables?

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
bizk

Hand-configuring Environmental variables?

Post by bizk »

Hi All
Is it possible to 'hand-code' Environmental variables into IM? If so, which files do I need to alter/create?
Here is why:
I have had a lot of problems compiling IM from source on OSX 10.4.8.
However the binary distribution seems to work fine using the terminal.
I have carried out the advanced 'export path etc' and have proved that IM is working fine when given environmental variables and paths.
I am not able to permanently amend any environmental variables due to external restrictions.
I have tried to amend configure.xml to reflect the environmental variable changes I need IM to understand as follows:
<configure name="MAGICK_HOME" value="/Path/To/ImageMagick-6.3.1/" />
<configure name="DYLD_LIBRARY_PATH" value="/Path/To/ImageMagick-6.3.1/lib" />

It has had no effect and I am at a loss, despite reading any and all documentation I can find.
I need to access IM via html2ps as well as via a direct IM commandline after preparing postscript files.
Alternatively (if the above is not possible) is there a way to use html2ps from Imagemagick that can simply process html files and render them to an image?

cheers

Biz
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Post by magick »

ImageMagick has two types of installs: "installed" and "uninstalled". The default is installed and the ImageMagick paths are fixed relative to the install path, typically /usr/local, determined by the --prefix option of the configure script. Use the --disable-installed option to install ImageMagick anywhere on your system and have ImageMagick find its configuration files relative to the MAGICK_HOME environment variable.
bizk

Post by bizk »

Hi Magick

Thanks for that.
I have actually decided that it is safer to proceed just the one step at a time right now.
Therefore all I am trying to do is to get the binary IM working before I try to do anything more advanced. This should also render the need for a self-compiled binary obsolete.
I am being drawn in 2 directions.
  • 1 I can use
    convert /path/To/page.htm /path/To/page.jpg
    and it converts them fine, including any embedded jpeg, gif and png images.
    This seems to be using html2ps, but without the use of a stylesheet (yet). Any idea how I go about passing a css style option to convert, or of passing any one of several postscript style config files to it for html2ps to use? It seems to have difficulty resolving relative URLs too.

    2 If I can resolve the environment variable problem via config files (instructions or sample needed please???), then this means that the environmental variables issue is solved and I can get back to doing the coding I was doing to get the results I need.
    I am sure I am missing something obvious, but cannot figure it out, which is most frustrating!
Any ideas or hints?
cheers

Biz
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Post by magick »

You can change the html2ps parameters by editting the delegates.xml file.

The configure.xml file is read-only. Changes to it does not affect the environment of the ImageMagick programs of libraries. Hopefully you've seen http://www.imagemagick.org/script/resources.php for a discussion of the configuration files and environment variables. And http://www.imagemagick.org/script/binary-releases.php for a discussion of running the pre-built Unix-style ImageMagick distributions.
bizk

Post by bizk »

Hi Magick

I think I'd been getting confused!
There was a problem setting the 'export MAGICK_HOME="$HOME/ImageMagick-6.x.x" ' etc variables for the binary, but I am now passing this through to the (automated) commandline and it is behaving as expected. I was having to pass this through every time as the 'shell' session expires after each time I invoke it (I haven't built a longer-surviving session for security reasons!).

I will be having a tinker with the html2ps parameters in delegates.xml overnight! Hopefully it will be a little less confusing now.

I'll let you know how it goes.

cheers
Biz
Post Reply