From c6d106ec33fbdf7f4cfee7513626f8a695799815 Mon Sep 17 00:00:00 2001 From: "James R. Barlow" Date: Fri, 28 Aug 2015 03:59:35 -0700 Subject: [PATCH] Throw exception if iccprofiles not found instead of returning None So far iccprofiles were only missing for a user who had a custom and possibly broken ghostscript installation. --- ocrmypdf/pdfa.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ocrmypdf/pdfa.py b/ocrmypdf/pdfa.py index 503830a9..2eab70de 100644 --- a/ocrmypdf/pdfa.py +++ b/ocrmypdf/pdfa.py @@ -115,6 +115,8 @@ def _get_postscript_icc_path(): if os.path.exists(path): return path + raise FileNotFoundError("Could not find Ghostscript's iccprofiles") + def generate_pdfa_def(target_filename, pdfmark, icc='sRGB'): if icc == 'sRGB':