From 41663673185e50ec28d068f21e56771a06d1806c Mon Sep 17 00:00:00 2001 From: Louis Sautier Date: Thu, 19 Aug 2021 01:14:13 +0200 Subject: [PATCH] tests: vendor sRGB.icc instead of relying on distro-specific paths --- .travis.yml | 1 - src/img2pdf_test.py | 7 +++++-- src/tests/data/sRGB.icc | Bin 0 -> 6922 bytes 3 files changed, 5 insertions(+), 3 deletions(-) create mode 100644 src/tests/data/sRGB.icc diff --git a/.travis.yml b/.travis.yml index 564cb37..8f18940 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 diff --git a/src/img2pdf_test.py b/src/img2pdf_test.py index e05ea86..6d2ca36 100755 --- a/src/img2pdf_test.py +++ b/src/img2pdf_test.py @@ -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), diff --git a/src/tests/data/sRGB.icc b/src/tests/data/sRGB.icc new file mode 100644 index 0000000000000000000000000000000000000000..6f3efbf02db0a9b7e9b0f0696a81c77d2d3042da GIT binary patch literal 6922 zcmeI1XH-~($xKc5@^=mZ{2|B{-2XY=O#ny`xu+|b&p%6w zEqSkNbac-3(VMB(&Hv2(uO}iaiNgW_qVi|rS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