Merge pull request #16541 from Snuffleupagus/inline-image-mask-checks

Improve SMask/Mask lookup when parsing inline images
This commit is contained in:
Tim van der Meij 2023-06-11 13:01:45 +02:00 committed by GitHub
commit 9af50dc358
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -724,12 +724,14 @@ class PartialEvaluator {
return;
}
const softMask = dict.get("SM", "SMask") || false;
const mask = dict.get("Mask") || false;
const SMALL_IMAGE_DIMENSIONS = 200;
// Inlining small images into the queue as RGB data
if (isInline && !softMask && !mask && w + h < SMALL_IMAGE_DIMENSIONS) {
if (
isInline &&
!dict.has("SMask") &&
!dict.has("Mask") &&
w + h < SMALL_IMAGE_DIMENSIONS
) {
const imageObj = new PDFImage({
xref: this.xref,
res: resources,