Some minor bugfixes:

- invalid color transformation from CMYK color profiles
    - invalid unicode mapping for CID fonts
This commit is contained in:
Jakub Melka 2019-12-27 14:17:33 +01:00
parent 0c7b0e6c3d
commit 092173bbd9
2 changed files with 6 additions and 2 deletions

View File

@ -309,12 +309,15 @@ QColor PDFLittleCMS::getColorFromICC(const PDFColor& color, RenderingIntent rend
}
std::array<float, 4> inputBuffer = { };
const cmsUInt32Number channels = T_CHANNELS(cmsGetTransformInputFormat(transform));
const cmsUInt32Number format = cmsGetTransformInputFormat(transform);
const cmsUInt32Number channels = T_CHANNELS(format);
const cmsUInt32Number colorSpace = T_COLORSPACE(format);
const bool isCMYK = colorSpace == PT_CMYK;
if (channels == color.size() && channels <= inputBuffer.size())
{
for (size_t i = 0; i < color.size(); ++i)
{
inputBuffer[i] = color[i];
inputBuffer[i] = isCMYK ? color[i] * 100.0 : color[i];
}
std::array<float, 3> rgbOutputColor = { };

View File

@ -1785,6 +1785,7 @@ PDFFontCMap PDFFontCMap::createFromData(const QByteArray& data)
{
unicodeValue = (unicodeValue << 8) + static_cast<unsigned char>(byteArray[i]);
}
return unicodeValue;
}
}