Merge pull request #8921 from THausherr/patch-2

support tiff predictor for 16bit
This commit is contained in:
Tim van der Meij 2017-09-18 23:01:33 +02:00 committed by GitHub
commit 9c2e9dae26
3 changed files with 22 additions and 0 deletions

View File

@ -735,6 +735,19 @@ var PredictorStream = (function PredictorStreamClosure() {
buffer[pos] = buffer[pos - colors] + rawBytes[i];
pos++;
}
} else if (bits === 16) {
var bytesPerPixel = colors * 2;
for (i = 0; i < bytesPerPixel; ++i) {
buffer[pos++] = rawBytes[i];
}
for (; i < rowBytes; i += 2) {
var sum = ((rawBytes[i] & 0xFF) << 8) +
(rawBytes[i + 1] & 0xFF) +
((buffer[pos - bytesPerPixel] & 0xFF) << 8) +
(buffer[pos - bytesPerPixel + 1] & 0xFF);
buffer[pos++] = ((sum >> 8) & 0xFF);
buffer[pos++] = (sum & 0xFF);
}
} else {
var compArray = new Uint8Array(colors + 1);
var bitMask = (1 << bits) - 1;

View File

@ -0,0 +1 @@
https://issues.apache.org/jira/secure/attachment/12685775/GWG181_16Bit_CMYK_X4.pdf

View File

@ -706,6 +706,14 @@
"lastPage": 1,
"type": "eq"
},
{ "id": "issue6289",
"file": "pdfs/issue6289.pdf",
"md5": "0869f3d147c734ec484ffd492104095d",
"rounds": 1,
"link": true,
"lastPage": 1,
"type": "eq"
},
{ "id": "issue5509",
"file": "pdfs/issue5509.pdf",
"md5": "1975ef8db7355b1d691bc79d0749574b",