-
Notifications
You must be signed in to change notification settings - Fork 10.2k
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
JBIG2 symbol offsets #8932
JBIG2 symbol offsets #8932
Conversation
/botio-linux preview |
From: Bot.io (Linux m4)ReceivedCommand cmd_preview from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.67.70.0:8877/7b03522e1835136/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.67.70.0:8877/7b03522e1835136/output.txt Total script time: 2.31 mins Published |
@janpe2 Could you please resolve these merge conflicts, so that we can test this patch? :-) |
6629b6e
to
5d1074c
Compare
/botio test |
From: Bot.io (Linux m4)ReceivedCommand cmd_test from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.67.70.0:8877/6c6931fd5ad846d/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_test from @Snuffleupagus received. Current queue size: 1 Live output at: http://54.215.176.217:8877/89fecdff5743b9b/output.txt |
From: Bot.io (Linux m4)FailedFull output at http://54.67.70.0:8877/6c6931fd5ad846d/output.txt Total script time: 16.78 mins
Image differences available at: http://54.67.70.0:8877/6c6931fd5ad846d/reftest-analyzer.html#web=eq.log |
From: Bot.io (Windows)FailedFull output at http://54.215.176.217:8877/89fecdff5743b9b/output.txt Total script time: 29.46 mins
Image differences available at: http://54.215.176.217:8877/89fecdff5743b9b/reftest-analyzer.html#web=eq.log |
/botio makeref |
From: Bot.io (Windows)ReceivedCommand cmd_makeref from @timvandermeij received. Current queue size: 1 Live output at: http://54.215.176.217:8877/a1f650355ddcd56/output.txt |
From: Bot.io (Linux m4)ReceivedCommand cmd_makeref from @timvandermeij received. Current queue size: 0 Live output at: http://54.67.70.0:8877/d320c13b12ebc42/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.67.70.0:8877/d320c13b12ebc42/output.txt Total script time: 15.79 mins
|
From: Bot.io (Windows)SuccessFull output at http://54.215.176.217:8877/a1f650355ddcd56/output.txt Total script time: 27.69 mins
|
Thank you for fixing this! |
JBIG2 symbol offsets
JBIG2 text regions have a symbol positioning problem:


The top pixel row of symbols is missing. The row goes outside the text region because symbols are positioned one pixel too high. Here is another one:
jbig2_symbol_offset.pdf
In JBIG2 the
REFCORNER
value specifies which of the four corners of a symbol bitmap is positioned at the desired point (x, y). In practice (and in PDF.js) bitmaps are drawn starting from the left-top corner. IfREFCORNER
is other than left-top, some offsets are needed. Currently the JBIG2 decoder uses offsets that are one pixel too large. Thus the issue appears. Most oftenREFCORNER
is left-bottom, like in my PDFs above, so only the vertical position is wrong.When symbols are drawn, the correct offsets are one less than the symbol width and height. For example, the vertical offset when

REFCORNER
is left-bottom:Typically JBIG2 images have a high resolution, so one pixel errors in symbol positioning can't be easily seen. (And symbols are rarely so near the edge of the text region that they would be clipped.)
This PR may cause JBIG2-related regression tests to fail because symbols will be moved one pixel. The new rendering is the correct one.