tests: vendor sRGB.icc instead of relying on distro-specific paths
This commit is contained in:
parent
dfcaa52bec
commit
4166367318
3 changed files with 5 additions and 3 deletions
|
@ -13,7 +13,6 @@ matrix:
|
||||||
- netpbm
|
- netpbm
|
||||||
- ghostscript
|
- ghostscript
|
||||||
- mupdf-tools
|
- mupdf-tools
|
||||||
- icc-profiles-free
|
|
||||||
- name: "python 3.9 Windows"
|
- name: "python 3.9 Windows"
|
||||||
os: windows
|
os: windows
|
||||||
language: shell # 'language: python' is an error on Travis CI Windows
|
language: shell # 'language: python' is an error on Travis CI Windows
|
||||||
|
|
|
@ -20,6 +20,9 @@ import warnings
|
||||||
import json
|
import json
|
||||||
import pathlib
|
import pathlib
|
||||||
|
|
||||||
|
SCRIPT_DIR = pathlib.Path(__file__).resolve().parent
|
||||||
|
ICC_PROFILE = SCRIPT_DIR / "tests" / "data" / "sRGB.icc"
|
||||||
|
|
||||||
HAVE_MUTOOL = True
|
HAVE_MUTOOL = True
|
||||||
try:
|
try:
|
||||||
ver = subprocess.check_output(["mutool", "-v"], stderr=subprocess.STDOUT)
|
ver = subprocess.check_output(["mutool", "-v"], stderr=subprocess.STDOUT)
|
||||||
|
@ -304,7 +307,7 @@ def compare(im1, im2, exact, icc, cmyk):
|
||||||
else:
|
else:
|
||||||
iccargs = []
|
iccargs = []
|
||||||
if icc:
|
if icc:
|
||||||
iccargs = ["-profile", "/usr/share/color/icc/sRGB.icc"]
|
iccargs = ["-profile", ICC_PROFILE]
|
||||||
psnr = subprocess.run(
|
psnr = subprocess.run(
|
||||||
["compare"]
|
["compare"]
|
||||||
+ iccargs
|
+ iccargs
|
||||||
|
@ -424,7 +427,7 @@ def compare_pdfimages_png(tmpdir, img, pdf, exact=True, icc=False):
|
||||||
"PSNR",
|
"PSNR",
|
||||||
"(",
|
"(",
|
||||||
"-profile",
|
"-profile",
|
||||||
"/usr/share/color/icc/ghostscript/srgb.icc",
|
ICC_PROFILE,
|
||||||
"-depth",
|
"-depth",
|
||||||
"8",
|
"8",
|
||||||
str(img),
|
str(img),
|
||||||
|
|
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