[GM-commit] GraphicsMagick: Add support for MAGICK_GHOSTSCRIPT_PATH environm...
Swiss army knife of image processing
Brought to you by:
bfriesen
From: GraphicsMagick C. <gra...@li...> - 2014-07-27 21:59:04
|
changeset b90fee1eec8f in /hg/GraphicsMagick details: http://hg.GraphicsMagick.org/hg/GraphicsMagick?cmd=changeset;node=b90fee1eec8f summary: Add support for MAGICK_GHOSTSCRIPT_PATH environment variable under Windows. diffstat: ChangeLog | 5 +++++ doc/environment.imdoc | 8 ++++++++ magick/nt_base.c | 22 ++++++++++++++++++++-- utilities/gm.1 | 9 ++++++++- www/Changelog.html | 7 ++++++- www/GraphicsMagick.html | 15 +++++++++++++++ www/gm.html | 15 +++++++++++++++ 7 files changed, 77 insertions(+), 4 deletions(-) diffs (155 lines): diff -r c54c609f25d4 -r b90fee1eec8f ChangeLog --- a/ChangeLog Sun Jul 27 16:41:04 2014 -0500 +++ b/ChangeLog Sun Jul 27 16:58:50 2014 -0500 @@ -3,6 +3,11 @@ * magick/nt_base.c (NTResourceToBlob): Support loading mgk files as Windows resource from library if MagickLibName is defined. Patch contributed by Dirk Lemstra via SF patch #32. + (NTGhostscriptDLL): For Microsoft Windows, add support for a + MAGICK_GHOSTSCRIPT_PATH environment variable which specifies the + path to Ghostscript. If this environment variable is defined, + then the Windows registry is not used to find Ghostscript. Patch + contributed by Dirk Lemstra via SF patch #39. * magick/log.c: Added SetLogMethod() to allow an application/library to specify a function to be called for diff -r c54c609f25d4 -r b90fee1eec8f doc/environment.imdoc --- a/doc/environment.imdoc Sun Jul 27 16:41:04 2014 -0500 +++ b/doc/environment.imdoc Sun Jul 27 16:58:50 2014 -0500 @@ -99,6 +99,14 @@ Unix, and semi-colon delimited for Microsoft Windows). This user specified search path is used before trying the default search path.</abs> +<opt>MAGICK_GHOSTSCRIPT_PATH</opt> + +<abs>For Microsoft Windows, specify the path to the Ghostscript +installation rather than searching for it via the Windows registry. +This helps in case Ghostscript is not installed via the Ghostscript +Windows installer or the user wants more control over the Ghostscript +used.</abs> + <opt>MAGICK_HOME</opt> <abs>Path to top of GraphicsMagick installation directory. Only observed diff -r c54c609f25d4 -r b90fee1eec8f magick/nt_base.c --- a/magick/nt_base.c Sun Jul 27 16:41:04 2014 -0500 +++ b/magick/nt_base.c Sun Jul 27 16:58:50 2014 -0500 @@ -1116,8 +1116,26 @@ path[0]='\0'; if (NULL == result) - if (NTGhostscriptGetString("GS_DLL", cache, sizeof(cache))) - result=cache; + { + const char + *directory; + + directory=getenv("MAGICK_GHOSTSCRIPT_PATH"); + if (directory != (const char *) NULL) + { + FormatString(cache, "%.1024s%sgsdll%u.dll", directory, + DirectorySeparator, (unsigned int) sizeof(directory)*8); + if (IsAccessibleAndNotEmpty(cache)) + result=cache; + else + (void) LogMagickEvent(ConfigureEvent, GetMagickModule(), + "Unable to find ghostscript library: \"%s\"", cache); + } + else if (NTGhostscriptGetString("GS_DLL", cache, sizeof(cache))) + { + result=cache; + } + } if (result) { diff -r c54c609f25d4 -r b90fee1eec8f utilities/gm.1 --- a/utilities/gm.1 Sun Jul 27 16:41:04 2014 -0500 +++ b/utilities/gm.1 Sun Jul 27 16:58:50 2014 -0500 @@ -1,4 +1,4 @@ -.TH gm 1 "2014/05/21" "GraphicsMagick" +.TH gm 1 "2014/07/27" "GraphicsMagick" .TP .in 15 .in 15 @@ -4658,6 +4658,13 @@ Unix, and semi-colon delimited for Microsoft Windows). This user specified search path is used before trying the default search path. .TP +.B "MAGICK_GHOSTSCRIPT_PATH" +\fRFor Microsoft Windows, specify the path to the Ghostscript +installation rather than searching for it via the Windows registry. +This helps in case Ghostscript is not installed via the Ghostscript +Windows installer or the user wants more control over the Ghostscript +used. +.TP .B "MAGICK_HOME" \fRPath to top of GraphicsMagick installation directory. Only observed by "uninstalled" builds of GraphicsMagick which do not have their location diff -r c54c609f25d4 -r b90fee1eec8f www/Changelog.html --- a/www/Changelog.html Sun Jul 27 16:41:04 2014 -0500 +++ b/www/Changelog.html Sun Jul 27 16:58:50 2014 -0500 @@ -40,7 +40,12 @@ <ul class="simple"> <li>magick/nt_base.c (NTResourceToBlob): Support loading mgk files as Windows resource from library if MagickLibName is defined. -Patch contributed by Dirk Lemstra via SF patch #32.</li> +Patch contributed by Dirk Lemstra via SF patch #32. +(NTGhostscriptDLL): For Microsoft Windows, add support for a +MAGICK_GHOSTSCRIPT_PATH environment variable which specifies the +path to Ghostscript. If this environment variable is defined, +then the Windows registry is not used to find Ghostscript. Patch +contributed by Dirk Lemstra via SF patch #39.</li> <li>magick/log.c: Added SetLogMethod() to allow an application/library to specify a function to be called for logging. Patch contributed by Dirk Lemstra.</li> diff -r c54c609f25d4 -r b90fee1eec8f www/GraphicsMagick.html --- a/www/GraphicsMagick.html Sun Jul 27 16:41:04 2014 -0500 +++ b/www/GraphicsMagick.html Sun Jul 27 16:58:50 2014 -0500 @@ -5881,6 +5881,21 @@ ALT=">" BORDER=0 height=14 width=15><b><font face="Helvetica, Arial" ><font color="#00B04F"><font size="+1"> + MAGICK_GHOSTSCRIPT_PATH +</font></font></font></b></td></tr></table> +<table width="90%" border="0" cellspacing="0" cellpadding="8"> <tr><td width="6%"><br></td><td>For Microsoft Windows, specify the path to the Ghostscript +installation rather than searching for it via the Windows registry. +This helps in case Ghostscript is not installed via the Ghostscript +Windows installer or the user wants more control over the Ghostscript +used.</td></tr></table> +<table BORDER=0 WIDTH="94%"> +<tr> +<td width="3%"><br></td> +<td ALIGN=LEFT BGCOLOR="#FFFFFF"> +<img SRC="images/right_triangle_option.png" +ALT=">" BORDER=0 height=14 +width=15><b><font face="Helvetica, Arial" +><font color="#00B04F"><font size="+1"> MAGICK_HOME </font></font></font></b></td></tr></table> <table width="90%" border="0" cellspacing="0" cellpadding="8"> <tr><td width="6%"><br></td><td>Path to top of GraphicsMagick installation directory. Only observed diff -r c54c609f25d4 -r b90fee1eec8f www/gm.html --- a/www/gm.html Sun Jul 27 16:41:04 2014 -0500 +++ b/www/gm.html Sun Jul 27 16:58:50 2014 -0500 @@ -5844,6 +5844,21 @@ ALT=">" BORDER=0 height=14 width=15><b><font face="Helvetica, Arial" ><font color="#00B04F"><font size="+1"> + MAGICK_GHOSTSCRIPT_PATH +</font></font></font></b></td></tr></table> +<table width="90%" border="0" cellspacing="0" cellpadding="8"> <tr><td width="6%"><br></td><td>For Microsoft Windows, specify the path to the Ghostscript +installation rather than searching for it via the Windows registry. +This helps in case Ghostscript is not installed via the Ghostscript +Windows installer or the user wants more control over the Ghostscript +used.</td></tr></table> +<table BORDER=0 WIDTH="94%"> +<tr> +<td width="3%"><br></td> +<td ALIGN=LEFT BGCOLOR="#FFFFFF"> +<img SRC="images/right_triangle_option.png" +ALT=">" BORDER=0 height=14 +width=15><b><font face="Helvetica, Arial" +><font color="#00B04F"><font size="+1"> MAGICK_HOME </font></font></font></b></td></tr></table> <table width="90%" border="0" cellspacing="0" cellpadding="8"> <tr><td width="6%"><br></td><td>Path to top of GraphicsMagick installation directory. Only observed |