diff --git a/src/core/jpg.js b/src/core/jpg.js index 99bbf9e83..90ef8ade9 100644 --- a/src/core/jpg.js +++ b/src/core/jpg.js @@ -15,6 +15,7 @@ import { assert, BaseException, warn } from "../shared/util.js"; import { ColorSpaceUtils } from "./colorspace_utils.js"; +import { DeviceCmykCS } from "./colorspace.js"; import { grayToRGBA } from "../shared/image_utils.js"; import { readUint16 } from "./core_utils.js"; @@ -1349,6 +1350,13 @@ class JpegImage { _convertCmykToRgba(data) { 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; } diff --git a/test/test_manifest.json b/test/test_manifest.json index f5e178215..a07b827bf 100644 --- a/test/test_manifest.json +++ b/test/test_manifest.json @@ -2960,6 +2960,15 @@ "rounds": 1, "type": "eq" }, + { + "id": "cmykjpeg_nowasm", + "file": "pdfs/cmykjpeg.pdf", + "md5": "85d162b48ce98503a382d96f574f70a2", + "link": false, + "rounds": 1, + "type": "eq", + "useWasm": false + }, { "id": "issue4402_reduced", "file": "pdfs/issue4402_reduced.pdf",