You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I suppose it simply searches for "EI" sequence separated by whitespaces. But that is not enough. It is needed to calculate size of decoded image data from parameters like width, height, bit per component and color space. Then decode data and see for EOD or look for exactly right number of decoded bytes and then stop parsing image data as not every filter has EOD.
This is content stream from attached pdf:
100 0 0 100 0 0 cm
BI /W 4 /H 4 /CS /RGB /BPC 8
ID
00000z0z00zzz00z0zzz0zzzEI aazazaazzzaazazzzazzz
EI
Steps to reproduce the problem:
Open attached bi.pdf
What is the expected behavior? (add screenshot)
This is how it looks in any other pdf viewer. All pixels are present and interpolation is off.
What went wrong? (add screenshot)
Seems it stoped decoding image in middle where is byte sequence "EI " but in this context meant as color of pixel instead of "End of Image" keyword.
Another thing is that it uses image interpolation even that it should be disabled by default in pdf.
To enable interpolation it has to be:
BI /W 4 /H 4 /CS /RGB /BPC 8 /I true
Then it would look like this in correct pdf viewer:
The text was updated successfully, but these errors were encountered:
Attach (recommended) or Link to PDF file here:
bi.pdf
Along these lines in https://github.com/mozilla/pdf.js/blob/master/src/core/parser.js:
I suppose it simply searches for "EI" sequence separated by whitespaces. But that is not enough. It is needed to calculate size of decoded image data from parameters like width, height, bit per component and color space. Then decode data and see for EOD or look for exactly right number of decoded bytes and then stop parsing image data as not every filter has EOD.
This is content stream from attached pdf:
Steps to reproduce the problem:
What is the expected behavior? (add screenshot)

This is how it looks in any other pdf viewer. All pixels are present and interpolation is off.
What went wrong? (add screenshot)

Seems it stoped decoding image in middle where is byte sequence "EI " but in this context meant as color of pixel instead of "End of Image" keyword.
Another thing is that it uses image interpolation even that it should be disabled by default in pdf.
To enable interpolation it has to be:
Then it would look like this in correct pdf viewer:

The text was updated successfully, but these errors were encountered: