forked from josch/img2pdf
Compare commits
4 commits
4166367318
...
2c287a6e98
Author | SHA1 | Date | |
---|---|---|---|
2c287a6e98 | |||
1f3b456ac9 | |||
4c5b72dab0 | |||
853a1ec363 |
2 changed files with 15 additions and 1 deletions
|
@ -21,7 +21,17 @@ import json
|
|||
import pathlib
|
||||
|
||||
SCRIPT_DIR = pathlib.Path(__file__).resolve().parent
|
||||
ICC_PROFILE = SCRIPT_DIR / "tests" / "data" / "sRGB.icc"
|
||||
ICC_PROFILE = None
|
||||
ICC_PROFILE_PATHS = (
|
||||
"/usr/share/color/icc/ghostscript/srgb.icc",
|
||||
"/usr/share/ghostscript/9.54.0/iccprofiles/srgb.icc",
|
||||
"/usr/share/color/icc/sRGB.icc",
|
||||
"/usr/share/color/icc/OpenICC/sRGB.icc",
|
||||
)
|
||||
for path in ICC_PROFILE_PATHS:
|
||||
if os.path.exists(path):
|
||||
ICC_PROFILE = path
|
||||
break
|
||||
|
||||
HAVE_MUTOOL = True
|
||||
try:
|
||||
|
@ -307,6 +317,8 @@ def compare(im1, im2, exact, icc, cmyk):
|
|||
else:
|
||||
iccargs = []
|
||||
if icc:
|
||||
if ICC_PROFILE is None:
|
||||
pytest.skip("Could not locate an ICC profile")
|
||||
iccargs = ["-profile", ICC_PROFILE]
|
||||
psnr = subprocess.run(
|
||||
["compare"]
|
||||
|
@ -420,6 +432,8 @@ def compare_pdfimages_png(tmpdir, img, pdf, exact=True, icc=False):
|
|||
)
|
||||
else:
|
||||
if icc:
|
||||
if ICC_PROFILE is None:
|
||||
pytest.skip("Could not locate an ICC profile")
|
||||
psnr = subprocess.run(
|
||||
[
|
||||
"compare",
|
||||
|
|
Binary file not shown.
Loading…
Reference in a new issue