Merge pull request #19677 from Snuffleupagus/issue-19676
For JPEG images with CMYK-data, ensure that the alpha-component is set correctly when WebAssembly is disabled (issue 19676)
This commit is contained in:
commit
2f1497c9c4
@ -15,6 +15,7 @@
|
|||||||
|
|
||||||
import { assert, BaseException, warn } from "../shared/util.js";
|
import { assert, BaseException, warn } from "../shared/util.js";
|
||||||
import { ColorSpaceUtils } from "./colorspace_utils.js";
|
import { ColorSpaceUtils } from "./colorspace_utils.js";
|
||||||
|
import { DeviceCmykCS } from "./colorspace.js";
|
||||||
import { grayToRGBA } from "../shared/image_utils.js";
|
import { grayToRGBA } from "../shared/image_utils.js";
|
||||||
import { readUint16 } from "./core_utils.js";
|
import { readUint16 } from "./core_utils.js";
|
||||||
|
|
||||||
@ -1349,6 +1350,13 @@ class JpegImage {
|
|||||||
|
|
||||||
_convertCmykToRgba(data) {
|
_convertCmykToRgba(data) {
|
||||||
ColorSpaceUtils.cmyk.getRgbBuffer(data, 0, data.length / 4, data, 0, 8, 1);
|
ColorSpaceUtils.cmyk.getRgbBuffer(data, 0, data.length / 4, data, 0, 8, 1);
|
||||||
|
|
||||||
|
if (ColorSpaceUtils.cmyk instanceof DeviceCmykCS) {
|
||||||
|
// The alpha-component isn't updated by `DeviceCmykCS`, doing it manually.
|
||||||
|
for (let i = 3, ii = data.length; i < ii; i += 4) {
|
||||||
|
data[i] = 255;
|
||||||
|
}
|
||||||
|
}
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -2960,6 +2960,15 @@
|
|||||||
"rounds": 1,
|
"rounds": 1,
|
||||||
"type": "eq"
|
"type": "eq"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"id": "cmykjpeg_nowasm",
|
||||||
|
"file": "pdfs/cmykjpeg.pdf",
|
||||||
|
"md5": "85d162b48ce98503a382d96f574f70a2",
|
||||||
|
"link": false,
|
||||||
|
"rounds": 1,
|
||||||
|
"type": "eq",
|
||||||
|
"useWasm": false
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"id": "issue4402_reduced",
|
"id": "issue4402_reduced",
|
||||||
"file": "pdfs/issue4402_reduced.pdf",
|
"file": "pdfs/issue4402_reduced.pdf",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user