summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlbert Astals Cid <aacid@kde.org>2020-07-09 00:28:48 +0200
committerAlbert Astals Cid <aacid@kde.org>2020-07-09 23:41:22 +0200
commitb2fadd0f7c5346c07181dd3730bf8d8a255f55b0 (patch)
tree46d20647140c30ac0d2aad1e20d59d284ab60488
parent2ec6bb9d0b1cfb3a1176e2b761b99c8e9d712642 (diff)
Fix conversion to PS in locales where decimal point is ,
The bug is only present in newer versions of lcms
-rw-r--r--poppler/GfxState.cc10
1 files changed, 10 insertions, 0 deletions
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;