From fef9647c01f01c7d45931643ef5afa69251ed319 Mon Sep 17 00:00:00 2001 From: Maxim Date: Thu, 10 Oct 2024 21:02:32 +0300 Subject: [PATCH] Add new methods to PBoxPDXImage --- .../model/impl/pb/pd/images/PBoxPDInlineImage.java | 6 ++++++ .../verapdf/model/impl/pb/pd/images/PBoxPDXImage.java | 10 +++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/pdfbox-validation-model/src/main/java/org/verapdf/model/impl/pb/pd/images/PBoxPDInlineImage.java b/pdfbox-validation-model/src/main/java/org/verapdf/model/impl/pb/pd/images/PBoxPDInlineImage.java index d47bc817..eab666be 100644 --- a/pdfbox-validation-model/src/main/java/org/verapdf/model/impl/pb/pd/images/PBoxPDInlineImage.java +++ b/pdfbox-validation-model/src/main/java/org/verapdf/model/impl/pb/pd/images/PBoxPDInlineImage.java @@ -73,6 +73,11 @@ public Long getBitsPerComponent() { return (long)((PDImage)simplePDObject).getBitsPerComponent(); } + @Override + public Boolean getisMask() { + return false; + } + @Override public String getSubtype() { return null; @@ -112,6 +117,7 @@ public List getLinkedObjects(String link) { return this.getIntent(); case PBoxPDXImage.IMAGE_CS: return this.getImageCS(); + case PBoxPDXImage.MASK: case PBoxPDXImage.S_MASK: case PBoxPDXObject.OPI: case PBoxPDXImage.ALTERNATES: diff --git a/pdfbox-validation-model/src/main/java/org/verapdf/model/impl/pb/pd/images/PBoxPDXImage.java b/pdfbox-validation-model/src/main/java/org/verapdf/model/impl/pb/pd/images/PBoxPDXImage.java index 733caeca..6b8fdaad 100644 --- a/pdfbox-validation-model/src/main/java/org/verapdf/model/impl/pb/pd/images/PBoxPDXImage.java +++ b/pdfbox-validation-model/src/main/java/org/verapdf/model/impl/pb/pd/images/PBoxPDXImage.java @@ -59,6 +59,7 @@ public class PBoxPDXImage extends PBoxPDXObject implements PDXImage { public static final String INTENT = "Intent"; public static final String JPX_STREAM = "jpxStream"; public static final String S_MASK = "SMask"; + public static final String MASK = "Mask"; private final boolean interpolate; private List jpeg2000List = null; @@ -85,6 +86,11 @@ public Long getBitsPerComponent() { return (long)((PDImageXObjectProxy)simplePDObject).getBitsPerComponent(); } + @Override + public Boolean getisMask() { + return false; + } + @Override public Boolean getcontainsAlternates() { COSBase pageObject = this.simplePDObject.getCOSObject(); @@ -104,7 +110,9 @@ public List getLinkedObjects(String link) { case JPX_STREAM: return this.getJPXStream(); case S_MASK: - return this.getSMask(); + return this.getSMask(); + case MASK: + return Collections.emptyList(); default: return super.getLinkedObjects(link); }