[
https://issues.apache.org/jira/browse/PDFBOX-5375?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17493945#comment-17493945
]
Thomas Ledoux commented on PDFBOX-5375:
---------------------------------------
Hi Andreas and Tilman,
indeed my only need is that the constructor doesn't decode the image in an
unexpected way.
The implementation I made was possible only because I was able to access the
code (the beauty of open source !!!) and I could retro-engineer how the
PDFXObjectImage was build. From a user of pdfbox, it seems to me that a lot to
learn on the interns of the library.
Moreover, I'm trying to reimplement the algorithm using the contentstream
classes and having the same problem I seems lilke I will have to redefine a
PDImage implementation as well as another DrawObject operator.
So the idea of having a constructor that just detect the JPX filter would be a
great improvement.
> Allow creating of PDFXObjectImage without accessing to the image stream
> -----------------------------------------------------------------------
>
> Key: PDFBOX-5375
> URL: https://issues.apache.org/jira/browse/PDFBOX-5375
> Project: PDFBox
> Issue Type: Bug
> Components: PDModel
> Affects Versions: 2.0.25, 3.0.0 PDFBox
> Reporter: Thomas Ledoux
> Priority: Major
> Attachments: patch.txt, patch2.txt
>
>
> Currently, when a PDF embeds JPEG2000 images, the simple parsing of the file
> generates a warning
> when the code hits a call to getXObject(name) from a PDResources for a image
> without creating the
> underlining PDFXObjectImage object, related to the absence of the JAI
> third-party.
> However, when we just want to access the width or height propertis (which are
> defined outside the stream in the associated dictionnary).
> Looking at the constructor of PDFXObjectImage, it appears that the image is
> always read to retrieve the colorspace.
> The proposed patch is moved this initialization to the getColorSpace() method
> so that the object is created and the Exception will be raised only if the
> image needs to be really accessed.
--
This message was sent by Atlassian Jira
(v8.20.1#820001)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]