Skip to content

Conversation

@matejriseksc
Copy link

@matejriseksc matejriseksc commented Mar 22, 2021

According to https://docs.oracle.com/javase/8/docs/api/javax/imageio/metadata/doc-files/jpeg_metadata.html the number of image components should be read from the markerSequence/sof/@numFrameComponents if you want to retrieve the number of the whole image.

At the moment the number is being read from the first Start Of Scan marker segment (sos) xPath encounters which in our case lead to the wrong classification of an image as a Grayscale instead of RGB resulting in a blank image added to the final PDF document.

According to https://docs.oracle.com/javase/8/docs/api/javax/imageio/metadata/doc-files/jpeg_metadata.html the number of image components should be read from the markerSequence/sof/@numFrameComponents if you want to retrieve the number of the whole image.

At the moment the number is being read from the first `Start Of Scan marker segment` (sos) xPath encounters which in our case lead to the wrong classification of an image as a Grayscale instead of RGB resulting in a blank image added to the final PDF document.
@matejriseksc
Copy link
Author

@THausherr
Copy link
Contributor

Can you share this image? The oracle text is hard to understand. But I looked into the source code of twelvemonkeys, this confirms what you wrote.

@asfgit asfgit closed this in 094b3c8 May 21, 2021
asfgit pushed a commit that referenced this pull request May 21, 2021
…mponents to get component count, as suggested by Matej Risek and Stéphane Vallée; closes #110

git-svn-id: https://svn.apache.org/repos/asf/pdfbox/branches/2.0@1890059 13f79535-47bb-0310-9956-ffa450edef68
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants