Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java.lang.IllegalArgumentException: Numbers of source Raster bands and source color space components do not match #693

Closed
tresf opened this issue Jul 17, 2020 · 9 comments
Assignees
Milestone

Comments

@tresf
Copy link
Contributor

tresf commented Jul 17, 2020

On occasion, a PDF has embedded image data which Java is unable to process.

Leveraging a 3rd party image processing library -- e.g. https://github.com/haraldk/TwelveMonkeys -- may fix this.

A PDF which causes this is available here: 001921EB.pdf (restricted)

If Twelvemonkeys fixes this PDF, we'll need to investigate if it's a good candidate for inclusion into a future version of QZ Tray.

@akberenz
Copy link
Member

akberenz commented Sep 4, 2020

Twelvemokey fixes this - I've only included the jpeg library (with dependencies) in the pull request, but we should be able to drop in the other image specific ones as desired without having to add additional dependencies.

@tresf
Copy link
Contributor Author

tresf commented Sep 8, 2020

@klabarge can you please do some regression testing against #706 (memory, performance, compatibility?)

@klabarge
Copy link
Member

macOS

I did macOS testing using openjdk version "11.0.4" 2019-07-16

Speed

So far on macOS there is no noticeable speed difference in regression testing

  • Printing the sample.pdf against the master branch takes about 2 seconds
    • twelvemonkeys branch: (20:19:14,249- 20:19:16,069)
    • master branch: (19:15:25,094 - 19:15:26,766)

Quality

The offending PDF prints in poor quality unless the DPI is specified. When 600 DPI is used, it takes about 7 seconds to print but the size is 18.5MB so that's almost expected.

image

It prints at a poor quality unless a DPI is specified. 307kb. When 600 DPI is specified the size is 18.5MB

image

Memory

When I send this PDF through 10 times the memory usage of QZ Tray goes to 4.36GB and stays around this level until QZ Tray is restarted

@klabarge
Copy link
Member

Windows

Testing done with openjdk version "11.0.8" 2020-07-14

Speed

The speed is the same in regression testing

Quality

On Windows the quality of print is good without specifying DPI/ rasterize.

Memory

The Memory of QZ Tray peaks around 1GB. This is the same in regression testing

@klabarge
Copy link
Member

Ubuntu

openjdk version "11.0.3" 2019-04-16

Speed

The speed is the same in regression testing

Quality

The quality of print is good without specifying DPI/rasterization

Memory

The Memory of QZ Tray peaks around 1GB. This is the same in regression testing

@tresf
Copy link
Contributor Author

tresf commented Sep 23, 2020

The offending PDF prints in poor quality unless the DPI is specified.

@klabarge is this a regression or is this consistent with other PDFs on your machine?

@klabarge
Copy link
Member

klabarge commented Sep 23, 2020

@klabarge is this a regression or is this consistent with other PDFs on your machine?

I tested other PDF's (and they had fine quality) but not specifically a PDF with an image embedded in it. Windows and Ubuntu do not suffer this issue though

@tresf
Copy link
Contributor Author

tresf commented Sep 23, 2020

I tested other PDF's but not specifically a PDF with an image embedded in it.

We can't merge until we know if this is standard behavior or a regression on your machine.

@tresf
Copy link
Contributor Author

tresf commented Sep 28, 2020

I still haven't received a reply about if the observed behavior was a regression. I guess we'll tackle it in QA for 2.1.3. Note, as of 3b77e06, DPI won't force rasterization, so a higher dpi should be attainable much faster as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants