Delegate to independet ghostscript

Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
Post Reply
andifo
Posts: 9
Joined: 2011-11-29T04:42:31-07:00
Authentication code: 8675308

Delegate to independet ghostscript

Post by andifo »

I'm using imagemagick for batch conversion of EPS images to jpg images. So there is a need for ghostscript.

Unfortunately i have to avoid installations on the server for several reasons. So I'm using the the un-installed version of imagemagick (see below). And i have to use an un-installed version of ghostscript packaged with the application as a relative directory.

The problem is, that there is already an older ghostscript version installed on the server, which created a windows registry entry and imagemagick seems to use that registry entry for resolving the path to the ghostscript executable. For some other dependencies this installation can not be deleted.

On the page http://www.imagemagick.org/script/resources.php I found that the delegate can be configured using the delegates.xml file.
For an uninstalled windows version the configuration load order is described as followed:
$MAGICK_CONFIGURE_PATH
$MAGICK_HOME
$USERPROFILE/.magick/
client path
<current directory>

So i put the adapted delegates.xml beside the convert.exe and made the path public by setting the environment variable $MAGICK_CONFIGURE_PATH.

With convert -list delegate and identify -list delegate I see that there seems to be still another delegate file, which is evaluated by ghostscript as the configurations for
"eps" encode="ps" are duplicated, one with the ghostscript reference from the windows registry and the other with the reference from my delegates.xml ?!?

Unzipping convert.exe showed, that there is an internal delegates.xml inside the exe, which is still evaluated, though there is another one in the search path.

So, what is wrong with that? Do i have to set another configuration to avoid that the internal delegates.xml is avoided? How can I achieve that I can set the path to a specific ghostscript executable ignoring the windows registry entry? Is this specific for the un-installed version of imagemagick?

Using:
ImageMagick-6.7.3-Q16-windows.zip (Portable Win32 static at 16 bits-per-pixel. Just copy to your host and run (no installer, no Windows registry entries).
Ghostscript 9.04

Enwiroment: Windows XP / Windows 7

Thanks in advance for any hint, help or solution.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Delegate to independet ghostscript

Post by magick »

We can reproduce the problem you posted and have a patch. Look for it in the next point release of ImageMagick within a week or two. Thanks.
andifo
Posts: 9
Joined: 2011-11-29T04:42:31-07:00
Authentication code: 8675308

Re: Delegate to independet ghostscript

Post by andifo »

Wow, this was a very fast answer! Thanks a lot.

Do you know if this problem existed in earlier versions too? Maybe I can use an older version in the meanwhile in my application, as it is an important and urgent feature.

Do you have any detailed information about the release plan? Is it sure that this release will come in the next two weeks or is it possible that it will postponed?
Sorry, I just ask about that, to make a decision about possible workarounds in the meanwhile.

Again, thanks a lot for the great support.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Delegate to independet ghostscript

Post by magick »

We're not sure when ImageMagick starting picking up its internal delegates. They should only be read if no other delegates file is found. This is a Windows specific problem, it does not happen under Linux / Mac.

Most likely the bug fix will be available this weekend.
andifo
Posts: 9
Joined: 2011-11-29T04:42:31-07:00
Authentication code: 8675308

Re: Delegate to independet ghostscript

Post by andifo »

Thanks again for the great support!
andifo
Posts: 9
Joined: 2011-11-29T04:42:31-07:00
Authentication code: 8675308

Re: Delegate to independet ghostscript

Post by andifo »

Can you give me hint , when there is a new version fixing the problem and give me the version number for the download?

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

Re: Delegate to independet ghostscript

Post by magick »

andifo
Posts: 9
Joined: 2011-11-29T04:42:31-07:00
Authentication code: 8675308

Re: Delegate to independet ghostscript

Post by andifo »

Great!

You provided ImageMagick-6.7.3-10-Q16-windows-dll.exe, which is available on the offical download site. I need the portable, uninstalled version, which seems to be the oly one, which is not updated on the website. Current version ImageMagick-6.7.3-Q16-windows.zip.

Can you also provide the uninstalled version?
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Delegate to independet ghostscript

Post by magick »

The portable uninstalled release will be available sometime this weekend.
andifo
Posts: 9
Joined: 2011-11-29T04:42:31-07:00
Authentication code: 8675308

Re: Delegate to independet ghostscript

Post by andifo »

Sorry for asking again, but it is a very important feature I need.

The portable isnt' updated yet. Any new release plans?
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Delegate to independet ghostscript

Post by magick »

The portable release is updated. Its possible our patch does not resolve your problem. When you type
  • identify -list delegate
do you just get one list of delegates?
andifo
Posts: 9
Joined: 2011-11-29T04:42:31-07:00
Authentication code: 8675308

Re: Delegate to independet ghostscript

Post by andifo »

Well,

Code: Select all

identify -list configure
shows me that two delegate files seem to be evaluated, but in the output there are no more duplicate entries. So I can overwrite the built-in delegate values from my delegate file.

But when I do a eps-to-jpg conversion still the installed ghostscript version is used instead the uninstalled version I want to use.

I'm using the enviroment variables to make the location of the delegate.xml available. In fact my delegate.xml is parallel to the convert.exe.
$MAGICK_CONFIGURE_PATH
$MAGICK_HOME

When I use the -verbose parameter for the convert.exe I see the following in the output:
[ghostscript library] -q -dQUIET -dPARANOIDSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dEPSCrop -dAlignToPixels=0 -d ......

It seems that still the gslib registered in the windows registry is used instead my delegate configuration.

On the following site I found that statement:
http://imagemagick.sourceforge.net/http ... stall.html
Ghostscript (released 7.0 and later) may optionally install a library (libgs). If this library is installed, ImageMagick will attempt to use it unless the option --without-gslib is passed to configure.
It seems, that the ghostscript definition in the delegate.xml is not used in the uninstalled version of imagemagick, when there is an installed ghostscript with a gslib entry in the registry. Does this make sense? Do I have to configure something else?

Can this only be solved by compilation of the sources with

Code: Select all

--without-gslib
.

If yes, is it possible that you can provide me a version with this compilation configuration?

Thanks in advance.
andifo
Posts: 9
Joined: 2011-11-29T04:42:31-07:00
Authentication code: 8675308

Re: Delegate to independet ghostscript

Post by andifo »

The same as described in the previous post is true for the windows installation.
ImageMagick-6.7.3-10-Q16-windows-dll.exe

Always the gslib is used. When i de-install ghostscript than the entry from the delegate.xml is used:
"gswin32c.exe" -q -dQUIET -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dEPSCrop -dAlignToPixels=0 -dGridFitTT=2 "-sDEVICE=pamcmyk32"....

This is the result I need, but without de-installation of ghostscript. Can I achieve this by other entries in the configuration files?
andifo
Posts: 9
Joined: 2011-11-29T04:42:31-07:00
Authentication code: 8675308

Re: Delegate to independet ghostscript

Post by andifo »

Is it the only way to by-pass an installed ghostscript version by compiling imagemagick with "--without-gslib"?
Is there any other possibility to de-activate using an registered (Windows registry) ghostscript by setting specific configuration values without a need to re-compile imagemagick?

Do I miss a point? What is the best way to by-pass an installed ghostscript version?

I need this feature to call an uninstalled ghostscript version very urgent. So any help or hint regarding this topic is welcome.

Thanks in davance.
Post Reply