mirror of
https://github.com/JakubMelka/PDF4QT.git
synced 2025-02-09 00:08:53 +01:00
Some minor bugfixes:
- invalid color transformation from CMYK color profiles - invalid unicode mapping for CID fonts
This commit is contained in:
parent
0c7b0e6c3d
commit
092173bbd9
@ -309,12 +309,15 @@ QColor PDFLittleCMS::getColorFromICC(const PDFColor& color, RenderingIntent rend
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::array<float, 4> inputBuffer = { };
|
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())
|
if (channels == color.size() && channels <= inputBuffer.size())
|
||||||
{
|
{
|
||||||
for (size_t i = 0; i < color.size(); ++i)
|
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 = { };
|
std::array<float, 3> rgbOutputColor = { };
|
||||||
|
@ -1785,6 +1785,7 @@ PDFFontCMap PDFFontCMap::createFromData(const QByteArray& data)
|
|||||||
{
|
{
|
||||||
unicodeValue = (unicodeValue << 8) + static_cast<unsigned char>(byteArray[i]);
|
unicodeValue = (unicodeValue << 8) + static_cast<unsigned char>(byteArray[i]);
|
||||||
}
|
}
|
||||||
|
return unicodeValue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user