forked from josch/img2pdf
Compare commits
3 commits
2c287a6e98
...
4166367318
Author | SHA1 | Date | |
---|---|---|---|
4166367318 | |||
dfcaa52bec | |||
a143e31eb1 |
2 changed files with 1 additions and 15 deletions
|
@ -21,17 +21,7 @@ import json
|
||||||
import pathlib
|
import pathlib
|
||||||
|
|
||||||
SCRIPT_DIR = pathlib.Path(__file__).resolve().parent
|
SCRIPT_DIR = pathlib.Path(__file__).resolve().parent
|
||||||
ICC_PROFILE = None
|
ICC_PROFILE = SCRIPT_DIR / "tests" / "data" / "sRGB.icc"
|
||||||
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
|
HAVE_MUTOOL = True
|
||||||
try:
|
try:
|
||||||
|
@ -317,8 +307,6 @@ def compare(im1, im2, exact, icc, cmyk):
|
||||||
else:
|
else:
|
||||||
iccargs = []
|
iccargs = []
|
||||||
if icc:
|
if icc:
|
||||||
if ICC_PROFILE is None:
|
|
||||||
pytest.skip("Could not locate an ICC profile")
|
|
||||||
iccargs = ["-profile", ICC_PROFILE]
|
iccargs = ["-profile", ICC_PROFILE]
|
||||||
psnr = subprocess.run(
|
psnr = subprocess.run(
|
||||||
["compare"]
|
["compare"]
|
||||||
|
@ -432,8 +420,6 @@ def compare_pdfimages_png(tmpdir, img, pdf, exact=True, icc=False):
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
if icc:
|
if icc:
|
||||||
if ICC_PROFILE is None:
|
|
||||||
pytest.skip("Could not locate an ICC profile")
|
|
||||||
psnr = subprocess.run(
|
psnr = subprocess.run(
|
||||||
[
|
[
|
||||||
"compare",
|
"compare",
|
||||||
|
|
BIN
src/tests/data/sRGB.icc
Normal file
BIN
src/tests/data/sRGB.icc
Normal file
Binary file not shown.
Loading…
Reference in a new issue