tests: vendor sRGB.icc instead of relying on distro-specific paths

This commit is contained in:
Louis Sautier 2021-08-19 01:14:13 +02:00
parent dfcaa52bec
commit 4166367318
Signed by untrusted user: sbraz
GPG key ID: A777716B30AE82E3
3 changed files with 5 additions and 3 deletions

View file

@ -13,7 +13,6 @@ matrix:
- netpbm
- ghostscript
- mupdf-tools
- icc-profiles-free
- name: "python 3.9 Windows"
os: windows
language: shell # 'language: python' is an error on Travis CI Windows

View file

@ -20,6 +20,9 @@ import warnings
import json
import pathlib
SCRIPT_DIR = pathlib.Path(__file__).resolve().parent
ICC_PROFILE = SCRIPT_DIR / "tests" / "data" / "sRGB.icc"
HAVE_MUTOOL = True
try:
ver = subprocess.check_output(["mutool", "-v"], stderr=subprocess.STDOUT)
@ -304,7 +307,7 @@ def compare(im1, im2, exact, icc, cmyk):
else:
iccargs = []
if icc:
iccargs = ["-profile", "/usr/share/color/icc/sRGB.icc"]
iccargs = ["-profile", ICC_PROFILE]
psnr = subprocess.run(
["compare"]
+ iccargs
@ -424,7 +427,7 @@ def compare_pdfimages_png(tmpdir, img, pdf, exact=True, icc=False):
"PSNR",
"(",
"-profile",
"/usr/share/color/icc/ghostscript/srgb.icc",
ICC_PROFILE,
"-depth",
"8",
str(img),

BIN
src/tests/data/sRGB.icc Normal file

Binary file not shown.