[poppler] poppler/GfxState.cc

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Jul 9 21:45:49 UTC 2020


 poppler/GfxState.cc |   10 ++++++++++
 1 file changed, 10 insertions(+)

New commits:
commit b2fadd0f7c5346c07181dd3730bf8d8a255f55b0
Author: Albert Astals Cid <aacid at kde.org>
Date:   Thu Jul 9 00:28:48 2020 +0200

    Fix conversion to PS in locales where decimal point is ,
    
    The bug is only present in newer versions of lcms

diff --git a/poppler/GfxState.cc b/poppler/GfxState.cc
index 3f9da25d..76c74eb5 100644
--- a/poppler/GfxState.cc
+++ b/poppler/GfxState.cc
@@ -2233,6 +2233,16 @@ char *GfxICCBasedColorSpace::getPostScriptCSA()
     cmsGetPostScriptCSA(cmsGetProfileContextID(rawprofile), rawprofile, getIntent(), 0, psCSA, size);
     psCSA[size] = 0;
 
+    // TODO REMOVE-ME-IN-THE-FUTURE
+    // until we can depend on https://github.com/mm2/Little-CMS/issues/223 being fixed
+    // lcms returns ps code with , instead of . for some locales. The lcms author says
+    // that there's no room for any , in the rest of the ps code, so replacing all the , with .
+    // is an "acceptable" workaround
+    for (int i = 0; i < size; ++i) {
+        if (psCSA[i] == ',')
+            psCSA[i] = '.';
+    }
+
     return psCSA;
 #    else
     return nullptr;


More information about the poppler mailing list