-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
LibGfx/JBIG2: Fix rendering of transposed text, and add lots of tests #23810
Conversation
This already worked fine. Now it's tested. I did have to teach `jbig2` to correctly generate test files for this. See the PR adding these tests for local changes. I used the script from SerenityOS#23659 to create these images, but I replaced these lines: ``` -txt -Param -numInst 4 -ID 2 108 50 -ID 3 265 60 -ID 1 100 135 -ID 0 70 232 -txt -Param -RefCorner 2 ``` For `bottomleft`, I replaced them with: ``` -txt -Param -numInst 4 -ID 2 137 50 -ID 3 294 60 -ID 1 199 135 -ID 0 319 232 -txt -Param -RefCorner 0 ``` For `bottomright`, I replaced them with: ``` -txt -Param -numInst 4 -ID 2 108 50 -ID 3 265 60 -ID 1 100 135 -ID 0 70 232 -txt -Param -RefCorner 2 ``` For `topright`, I replaced them with: ``` -txt -Param -numInst 4 -ID 2 108 79 -ID 3 265 89 -ID 1 100 234 -ID 0 70 351 -txt -Param -RefCorner 3 ``` All three new files display fine in Chrome. The bottomleft one displays fine in Firefox, while the other two look compressed in X. I think this is a bug in pdf.js that I'll report upstream. (Reportedly they look fine in Acrobat on Android.)
The current code was incorrect for non-TopRight reference corners. Fixes rendering of ghostpdl/tests/jbig2/042_19.jb2.
This needed the same `jbig2` changes as for the non-transposed ones, and the changes to it mentioned on SerenityOS#23780. I used the same .ini files as for the non-transposed ones, except that I added `-txt -Param -Transposed 1` as last line to each of them. All three new files display fine in Chrome. They all look busted in Firefox. I think this is likey a bug in pdf.js that I'll report upstream. (Reportedly they look fine in Acrobat on Android.)
My additional local 0006-support-all-4-reference-corners-in-Jbig2_ImageMarg.patch (Previously: #23780 (comment)) |
Red CI is unrelated. |
Filed mozilla/pdf.js#17871 for the non-transposed bug in pdf.js / Firefox. Depending on how that one goes, I'll open another issue for the transposed files there later. |
The pdf.js team fixed mozilla/pdf.js#17871 in record time (🎉), so I opened mozilla/pdf.js#17883 for the transposed test cases rendering differently in pdf.js. |
The current code was incorrect for non-TopRight reference corners.
Fixes rendering of ghostpdl/tests/jbig2/042_19.jb2.