Main GraphicsMagick source repository
Revisión | 14555dd54b5b626aa5e1e56cbddf541ac6e21f2f (tree) |
---|---|
Tiempo | 2021-02-21 05:29:36 |
Autor | Bob Friesenhahn <bfriesen@Grap...> |
Commiter | Bob Friesenhahn |
Handle Ghostscript point versions added after 9.52.
@@ -1,5 +1,10 @@ | ||
1 | 1 | 2021-02-20 Bob Friesenhahn <bfriesen@simple.dallas.tx.us> |
2 | 2 | |
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 | + | |
3 | 8 | * fuzzing/oss-fuzz-build.sh: Patch by Paul Kehrer to incorporate |
4 | 9 | Jasper and libxml2 into the oss-fuzz build. |
5 | 10 |
@@ -232,8 +232,9 @@ | ||
232 | 232 | Use of lossless JPEG is not encouraged. Unless you have a requirement |
233 | 233 | to read lossless jpeg-encoded DICOM images, please disregard the patch. |
234 | 234 | |
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 | |
237 | 238 | |
238 | 239 | http://www.ece.uvic.ca/~mdadams/jasper/ |
239 | 240 |
@@ -1235,11 +1235,19 @@ | ||
1235 | 1235 | /* |
1236 | 1236 | Find the latest version of Ghostscript installed on the system (if |
1237 | 1237 | 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. | |
1238 | 1245 | */ |
1239 | 1246 | static MagickPassFail |
1240 | 1247 | NTGhostscriptFind(const char **gs_productfamily, |
1241 | 1248 | int *gs_major_version, |
1242 | - int *gs_minor_version) | |
1249 | + int *gs_minor_version, | |
1250 | + int *gs_point_version) | |
1243 | 1251 | { |
1244 | 1252 | /* |
1245 | 1253 | These are the Ghostscript product versions we will search for. |
@@ -1252,6 +1260,9 @@ | ||
1252 | 1260 | "Aladdin Ghostscript" |
1253 | 1261 | }; |
1254 | 1262 | |
1263 | + char | |
1264 | + gs_version[MaxTextExtent]; | |
1265 | + | |
1255 | 1266 | unsigned int |
1256 | 1267 | product_index, |
1257 | 1268 | whence; |
@@ -1268,6 +1279,10 @@ | ||
1268 | 1279 | /* Minimum version of Ghostscript is 5.50 */ |
1269 | 1280 | *gs_major_version=5; |
1270 | 1281 | *gs_minor_version=49; |
1282 | + *gs_point_version=0; | |
1283 | + | |
1284 | + gs_version[0]='\0'; | |
1285 | + | |
1271 | 1286 | for(whence=0; whence<=1; whence++) |
1272 | 1287 | { |
1273 | 1288 | const HKEY hkeyroot = hkeys[whence].hkey; |
@@ -1324,31 +1339,52 @@ | ||
1324 | 1339 | */ |
1325 | 1340 | while ((winstatus=RegEnumKeyA(hkey, n, key, cbData)) == ERROR_SUCCESS) |
1326 | 1341 | { |
1342 | + char | |
1343 | + gs_found_version[MaxTextExtent]; | |
1344 | + | |
1327 | 1345 | int |
1346 | + count, | |
1328 | 1347 | major_version, |
1329 | - minor_version; | |
1348 | + minor_version, | |
1349 | + point_version; | |
1330 | 1350 | |
1331 | 1351 | (void) LogMagickEvent(ConfigureEvent,GetMagickModule(), |
1332 | 1352 | " RegEnumKeyA enumerated \"%s\"",key); |
1333 | 1353 | n++; |
1334 | 1354 | major_version=0; |
1335 | 1355 | 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)) | |
1337 | 1361 | continue; |
1338 | 1362 | |
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 | + | |
1339 | 1368 | (void) LogMagickEvent(ConfigureEvent,GetMagickModule(), |
1340 | - " Found Ghostscript (%s) version %d.%02d", | |
1369 | + " Found Ghostscript (%s) version %s", | |
1341 | 1370 | products[product_index], |
1342 | - major_version, | |
1343 | - minor_version); | |
1371 | + gs_found_version); | |
1344 | 1372 | |
1345 | - if ((major_version > *gs_major_version) || | |
1373 | + if ((major_version > *gs_major_version) | |
1374 | + || | |
1346 | 1375 | ((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 | + ) | |
1348 | 1382 | { |
1349 | 1383 | *gs_productfamily=products[product_index]; |
1350 | 1384 | *gs_major_version=major_version; |
1351 | 1385 | *gs_minor_version=minor_version; |
1386 | + *gs_point_version=point_version; | |
1387 | + (void) strlcpy(gs_version,gs_found_version,sizeof(gs_version)); | |
1352 | 1388 | status=MagickPass; |
1353 | 1389 | } |
1354 | 1390 | } |
@@ -1386,9 +1422,8 @@ | ||
1386 | 1422 | if (status != MagickFail) |
1387 | 1423 | { |
1388 | 1424 | (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); | |
1392 | 1427 | } |
1393 | 1428 | else |
1394 | 1429 | { |
@@ -1396,6 +1431,7 @@ | ||
1396 | 1431 | "Failed to find Ghostscript!"); |
1397 | 1432 | *gs_major_version=0; |
1398 | 1433 | *gs_minor_version=0; |
1434 | + *gs_point_version=-1; | |
1399 | 1435 | } |
1400 | 1436 | |
1401 | 1437 | return status; |
@@ -1413,7 +1449,8 @@ | ||
1413 | 1449 | |
1414 | 1450 | static int |
1415 | 1451 | gs_major_version=0, |
1416 | - gs_minor_version=0; | |
1452 | + gs_minor_version=0, | |
1453 | + gs_point_version=-1; | |
1417 | 1454 | |
1418 | 1455 | unsigned int |
1419 | 1456 | i; |
@@ -1428,13 +1465,17 @@ | ||
1428 | 1465 | |
1429 | 1466 | if (NULL == gs_productfamily) |
1430 | 1467 | (void) NTGhostscriptFind(&gs_productfamily,&gs_major_version, |
1431 | - &gs_minor_version); | |
1468 | + &gs_minor_version,&gs_point_version); | |
1432 | 1469 | |
1433 | 1470 | if (NULL == gs_productfamily) |
1434 | 1471 | return MagickFail; |
1435 | 1472 | |
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); | |
1438 | 1479 | |
1439 | 1480 | for (i=0; i < sizeof(hkeys)/sizeof(hkeys[0]); ++i) |
1440 | 1481 | { |
@@ -37,8 +37,13 @@ | ||
37 | 37 | |
38 | 38 | <p>2021-02-20 Bob Friesenhahn <<a class="reference external" href="mailto:bfriesen%40simple.dallas.tx.us">bfriesen<span>@</span>simple<span>.</span>dallas<span>.</span>tx<span>.</span>us</a>></p> |
39 | 39 | <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> | |
42 | 47 | <p>2021-02-14 Bob Friesenhahn <<a class="reference external" href="mailto:bfriesen%40simple.dallas.tx.us">bfriesen<span>@</span>simple<span>.</span>dallas<span>.</span>tx<span>.</span>us</a>></p> |
43 | 48 | <blockquote> |
44 | 49 | * VisualMagick/All/All.vcproj.in: Fixes by sourcer42 |
@@ -259,8 +259,9 @@ | ||
259 | 259 | <p>Use of lossless JPEG is not encouraged. Unless you have a requirement |
260 | 260 | to read lossless jpeg-encoded DICOM images, please disregard the patch.</p> |
261 | 261 | </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> | |
264 | 265 | <blockquote> |
265 | 266 | <p><a class="reference external" href="http://www.ece.uvic.ca/~mdadams/jasper/">http://www.ece.uvic.ca/~mdadams/jasper/</a></p> |
266 | 267 | </blockquote> |