• R/O
  • SSH

GM: Commit

Main GraphicsMagick source repository


Commit MetaInfo

Revisión14555dd54b5b626aa5e1e56cbddf541ac6e21f2f (tree)
Tiempo2021-02-21 05:29:36
AutorBob Friesenhahn <bfriesen@Grap...>
CommiterBob Friesenhahn

Log Message

Handle Ghostscript point versions added after 9.52.

Cambiar Resumen

Diferencia incremental

diff -r 2692c5df45d0 -r 14555dd54b5b ChangeLog
--- a/ChangeLog Sat Feb 20 12:55:10 2021 -0600
+++ b/ChangeLog Sat Feb 20 14:29:36 2021 -0600
@@ -1,5 +1,10 @@
11 2021-02-20 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
22
3+ * magick/nt_base.c (NTGhostscriptFind,NTGhostscriptGetString):
4+ Handle Ghostscript point versions added after 9.52. Fixes
5+ SourceForge issue #636 'Failed to find Ghostscript' with
6+ Ghostscript version 9.53.0+.
7+
38 * fuzzing/oss-fuzz-build.sh: Patch by Paul Kehrer to incorporate
49 Jasper and libxml2 into the oss-fuzz build.
510
diff -r 2692c5df45d0 -r 14555dd54b5b README.txt
--- a/README.txt Sat Feb 20 12:55:10 2021 -0600
+++ b/README.txt Sat Feb 20 14:29:36 2021 -0600
@@ -232,8 +232,9 @@
232232 Use of lossless JPEG is not encouraged. Unless you have a requirement
233233 to read lossless jpeg-encoded DICOM images, please disregard the patch.
234234
235-* GraphicsMagick requires the JasPer Project's JasPer library version
236- 1.701.0 (or later) available via http from
235+* GraphicsMagick requires the JasPer Project's JasPer library from
236+ https://github.com/jasper-software/jasper, although older versions
237+ 1.701.0 are available via http from
237238
238239 http://www.ece.uvic.ca/~mdadams/jasper/
239240
diff -r 2692c5df45d0 -r 14555dd54b5b magick/nt_base.c
--- a/magick/nt_base.c Sat Feb 20 12:55:10 2021 -0600
+++ b/magick/nt_base.c Sat Feb 20 14:29:36 2021 -0600
@@ -1235,11 +1235,19 @@
12351235 /*
12361236 Find the latest version of Ghostscript installed on the system (if
12371237 any).
1238+
1239+ Major version is one digit
1240+ Minor version is observed to two digits (zero prefixed if necessary)
1241+ Point version has one digit and 0 is used.
1242+
1243+ Point version was added after ghostscript 9.52
1244+ The gs_point_version value is valid if it is not -1.
12381245 */
12391246 static MagickPassFail
12401247 NTGhostscriptFind(const char **gs_productfamily,
12411248 int *gs_major_version,
1242- int *gs_minor_version)
1249+ int *gs_minor_version,
1250+ int *gs_point_version)
12431251 {
12441252 /*
12451253 These are the Ghostscript product versions we will search for.
@@ -1252,6 +1260,9 @@
12521260 "Aladdin Ghostscript"
12531261 };
12541262
1263+ char
1264+ gs_version[MaxTextExtent];
1265+
12551266 unsigned int
12561267 product_index,
12571268 whence;
@@ -1268,6 +1279,10 @@
12681279 /* Minimum version of Ghostscript is 5.50 */
12691280 *gs_major_version=5;
12701281 *gs_minor_version=49;
1282+ *gs_point_version=0;
1283+
1284+ gs_version[0]='\0';
1285+
12711286 for(whence=0; whence<=1; whence++)
12721287 {
12731288 const HKEY hkeyroot = hkeys[whence].hkey;
@@ -1324,31 +1339,52 @@
13241339 */
13251340 while ((winstatus=RegEnumKeyA(hkey, n, key, cbData)) == ERROR_SUCCESS)
13261341 {
1342+ char
1343+ gs_found_version[MaxTextExtent];
1344+
13271345 int
1346+ count,
13281347 major_version,
1329- minor_version;
1348+ minor_version,
1349+ point_version;
13301350
13311351 (void) LogMagickEvent(ConfigureEvent,GetMagickModule(),
13321352 " RegEnumKeyA enumerated \"%s\"",key);
13331353 n++;
13341354 major_version=0;
13351355 minor_version=0;
1336- if (sscanf(key,"%d.%d",&major_version,&minor_version) != 2) /* FIXME: Handle d.d.d */
1356+ point_version=-1;
1357+
1358+ /* Version string may be like 9.27, or 9.53.0, or 9.53.3 */
1359+ count=sscanf(key,"%d.%d.%d",&major_version,&minor_version,&point_version);
1360+ if ((count != 2) && (count != 3))
13371361 continue;
13381362
1363+ if (count == 3)
1364+ FormatString(gs_found_version,"%d.%02d.%d",major_version, minor_version, point_version);
1365+ else
1366+ FormatString(gs_found_version,"%d.%02d",major_version, minor_version);
1367+
13391368 (void) LogMagickEvent(ConfigureEvent,GetMagickModule(),
1340- " Found Ghostscript (%s) version %d.%02d",
1369+ " Found Ghostscript (%s) version %s",
13411370 products[product_index],
1342- major_version,
1343- minor_version);
1371+ gs_found_version);
13441372
1345- if ((major_version > *gs_major_version) ||
1373+ if ((major_version > *gs_major_version)
1374+ ||
13461375 ((major_version == *gs_major_version) &&
1347- (minor_version > *gs_minor_version)))
1376+ (minor_version > *gs_minor_version))
1377+ ||
1378+ ((major_version == *gs_major_version) &&
1379+ (minor_version == *gs_minor_version) &&
1380+ (point_version > *gs_point_version))
1381+ )
13481382 {
13491383 *gs_productfamily=products[product_index];
13501384 *gs_major_version=major_version;
13511385 *gs_minor_version=minor_version;
1386+ *gs_point_version=point_version;
1387+ (void) strlcpy(gs_version,gs_found_version,sizeof(gs_version));
13521388 status=MagickPass;
13531389 }
13541390 }
@@ -1386,9 +1422,8 @@
13861422 if (status != MagickFail)
13871423 {
13881424 (void) LogMagickEvent(ConfigureEvent,GetMagickModule(),
1389- "Selected Ghostscript (%s) version %d.%02d",
1390- *gs_productfamily,*gs_major_version,
1391- *gs_minor_version);
1425+ "Selected Ghostscript (%s) version %s",
1426+ *gs_productfamily, gs_version);
13921427 }
13931428 else
13941429 {
@@ -1396,6 +1431,7 @@
13961431 "Failed to find Ghostscript!");
13971432 *gs_major_version=0;
13981433 *gs_minor_version=0;
1434+ *gs_point_version=-1;
13991435 }
14001436
14011437 return status;
@@ -1413,7 +1449,8 @@
14131449
14141450 static int
14151451 gs_major_version=0,
1416- gs_minor_version=0;
1452+ gs_minor_version=0,
1453+ gs_point_version=-1;
14171454
14181455 unsigned int
14191456 i;
@@ -1428,13 +1465,17 @@
14281465
14291466 if (NULL == gs_productfamily)
14301467 (void) NTGhostscriptFind(&gs_productfamily,&gs_major_version,
1431- &gs_minor_version);
1468+ &gs_minor_version,&gs_point_version);
14321469
14331470 if (NULL == gs_productfamily)
14341471 return MagickFail;
14351472
1436- FormatString(key,"SOFTWARE\\%s\\%d.%02d",gs_productfamily,
1437- gs_major_version, gs_minor_version);
1473+ if (gs_point_version >= 0)
1474+ FormatString(key,"SOFTWARE\\%s\\%d.%02d.%d",gs_productfamily,
1475+ gs_major_version, gs_minor_version, gs_point_version);
1476+ else
1477+ FormatString(key,"SOFTWARE\\%s\\%d.%02d",gs_productfamily,
1478+ gs_major_version, gs_minor_version);
14381479
14391480 for (i=0; i < sizeof(hkeys)/sizeof(hkeys[0]); ++i)
14401481 {
diff -r 2692c5df45d0 -r 14555dd54b5b www/Changelog.html
--- a/www/Changelog.html Sat Feb 20 12:55:10 2021 -0600
+++ b/www/Changelog.html Sat Feb 20 14:29:36 2021 -0600
@@ -37,8 +37,13 @@
3737
3838 <p>2021-02-20 Bob Friesenhahn &lt;<a class="reference external" href="mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>
3939 <blockquote>
40-* fuzzing/oss-fuzz-build.sh: Patch by Paul Kehrer to incorporate
41-Jasper and libxml2 into the oss-fuzz build.</blockquote>
40+<p>* magick/nt_base.c (NTGhostscriptFind,NTGhostscriptGetString):
41+Handle Ghostscript point versions added after 9.52. Fixes
42+SourceForge issue #636 'Failed to find Ghostscript' with
43+Ghostscript version 9.53.0+.</p>
44+<p>* fuzzing/oss-fuzz-build.sh: Patch by Paul Kehrer to incorporate
45+Jasper and libxml2 into the oss-fuzz build.</p>
46+</blockquote>
4247 <p>2021-02-14 Bob Friesenhahn &lt;<a class="reference external" href="mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>
4348 <blockquote>
4449 * VisualMagick/All/All.vcproj.in: Fixes by sourcer42
diff -r 2692c5df45d0 -r 14555dd54b5b www/README.html
--- a/www/README.html Sat Feb 20 12:55:10 2021 -0600
+++ b/www/README.html Sat Feb 20 14:29:36 2021 -0600
@@ -259,8 +259,9 @@
259259 <p>Use of lossless JPEG is not encouraged. Unless you have a requirement
260260 to read lossless jpeg-encoded DICOM images, please disregard the patch.</p>
261261 </li>
262-<li><p class="first">GraphicsMagick requires the JasPer Project's JasPer library version
263-1.701.0 (or later) available via http from</p>
262+<li><p class="first">GraphicsMagick requires the JasPer Project's JasPer library from
263+<a class="reference external" href="https://github.com/jasper-software/jasper">https://github.com/jasper-software/jasper</a>, although older versions
264+1.701.0 are available via http from</p>
264265 <blockquote>
265266 <p><a class="reference external" href="http://www.ece.uvic.ca/~mdadams/jasper/">http://www.ece.uvic.ca/~mdadams/jasper/</a></p>
266267 </blockquote>
Show on old repository browser