From eb0a4ed3a83d45990bf9df467ae375c77c3dfd90 Mon Sep 17 00:00:00 2001 From: Tilman Hausherr Date: Tue, 3 Sep 2024 11:10:35 +0000 Subject: [PATCH] PDFBOX-5876: pass subsampling for second read git-svn-id: https://svn.apache.org/repos/asf/pdfbox/trunk@1920422 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/pdfbox/pdmodel/graphics/image/PDImageXObject.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/image/PDImageXObject.java b/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/image/PDImageXObject.java index 2c2b9d54e75..1d2e884476d 100644 --- a/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/image/PDImageXObject.java +++ b/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/image/PDImageXObject.java @@ -713,7 +713,8 @@ private void initJPXValues() // bits per component // the colorspace of the image is used if the dictionary doesn't provide any value PDStream stream = getStream(); - try (COSInputStream is = stream.createInputStream()) + DecodeOptions options = new DecodeOptions(cachedImageSubsampling); + try (COSInputStream is = stream.createInputStream(options)) { DecodeResult decodeResult = is.getDecodeResult(); stream.getCOSObject().addAll(decodeResult.getParameters());