Skip to content

Use positive dimensions for text chunks in the text layer (issue #14415) #14418

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

Merged
merged 1 commit into from
Jan 5, 2022

Conversation

calixteman
Copy link
Contributor

Width/height for text chunks must be positive numbers.

@calixteman calixteman marked this pull request as draft January 4, 2022 20:40
@calixteman calixteman force-pushed the 14415 branch 2 times, most recently from 1b103fe to 0a8bf5d Compare January 4, 2022 21:50
@calixteman
Copy link
Contributor Author

Just adding Math.abs on dims was not enough: no space were added between "This" and "agreement" because of the orientation (rotation == 180 and font size is negative).

@calixteman calixteman marked this pull request as ready for review January 4, 2022 21:54
@calixteman
Copy link
Contributor Author

/botio test

@pdfjsbot
Copy link

pdfjsbot commented Jan 4, 2022

From: Bot.io (Linux m4)


Received

Command cmd_test from @calixteman received. Current queue size: 0

Live output at: http://54.241.84.105:8877/63b86dd125117e4/output.txt

@pdfjsbot
Copy link

pdfjsbot commented Jan 4, 2022

From: Bot.io (Windows)


Received

Command cmd_test from @calixteman received. Current queue size: 0

Live output at: http://54.193.163.58:8877/9b12f6f8efe8746/output.txt

@pdfjsbot
Copy link

pdfjsbot commented Jan 4, 2022

From: Bot.io (Linux m4)


Failed

Full output at http://54.241.84.105:8877/63b86dd125117e4/output.txt

Total script time: 22.50 mins

  • Font tests: Passed
  • Unit tests: Passed
  • Integration Tests: Passed
  • Regression tests: FAILED
  different ref/snapshot: 13
  different first/second rendering: 1

Image differences available at: http://54.241.84.105:8877/63b86dd125117e4/reftest-analyzer.html#web=eq.log

@pdfjsbot
Copy link

pdfjsbot commented Jan 4, 2022

From: Bot.io (Windows)


Failed

Full output at http://54.193.163.58:8877/9b12f6f8efe8746/output.txt

Total script time: 42.42 mins

  • Font tests: Passed
  • Unit tests: Passed
  • Integration Tests: Passed
  • Regression tests: FAILED
  different ref/snapshot: 16
  different first/second rendering: 1

Image differences available at: http://54.193.163.58:8877/9b12f6f8efe8746/reftest-analyzer.html#web=eq.log

@Snuffleupagus
Copy link
Collaborator

There seem to be some regressions in taro-text-page3 (and taro-text-enhance-page3), for all platforms and browsers.

@calixteman
Copy link
Contributor Author

This is because of:
https://github.com/mozilla/pdf.js/pull/14418/files#diff-cf40014d9c7d352f3ae212e7fffe5386decf96a10e53066a4d900c3eb8fc559eR2479
I changed it because it's inconsistent with:

if (Math.abs(advanceX) > textContentItem.height) {

So for example, if you look on the fifth column on page 3:
image
before my patch we've a white, a break and a chunk with Japanese glyphes, and after my patch we've a chunk with a white and Japanese glyphes, the position of the span changed because the first char in the span is not the same.

Anyway, this change isn't directly related to what this patch is aimed to fix (I just noticed the error in reading the code and I thought that it doesn't hurt to fix a "typo").
So I'll remove it and I'll fix the issue in an other patch.

@calixteman
Copy link
Contributor Author

/botio test

@pdfjsbot
Copy link

pdfjsbot commented Jan 5, 2022

From: Bot.io (Linux m4)


Received

Command cmd_test from @calixteman received. Current queue size: 0

Live output at: http://54.241.84.105:8877/2d1863414a69a34/output.txt

@pdfjsbot
Copy link

pdfjsbot commented Jan 5, 2022

From: Bot.io (Windows)


Received

Command cmd_test from @calixteman received. Current queue size: 0

Live output at: http://54.193.163.58:8877/eeba09b2d2e4d35/output.txt

@pdfjsbot
Copy link

pdfjsbot commented Jan 5, 2022

From: Bot.io (Linux m4)


Failed

Full output at http://54.241.84.105:8877/2d1863414a69a34/output.txt

Total script time: 22.49 mins

  • Font tests: Passed
  • Unit tests: Passed
  • Integration Tests: Passed
  • Regression tests: FAILED
  different ref/snapshot: 9
  different first/second rendering: 1

Image differences available at: http://54.241.84.105:8877/2d1863414a69a34/reftest-analyzer.html#web=eq.log

@pdfjsbot
Copy link

pdfjsbot commented Jan 5, 2022

From: Bot.io (Windows)


Failed

Full output at http://54.193.163.58:8877/eeba09b2d2e4d35/output.txt

Total script time: 42.46 mins

  • Font tests: Passed
  • Unit tests: Passed
  • Integration Tests: Passed
  • Regression tests: FAILED
  different ref/snapshot: 7
  different first/second rendering: 1

Image differences available at: http://54.193.163.58:8877/eeba09b2d2e4d35/reftest-analyzer.html#web=eq.log

@Snuffleupagus
Copy link
Collaborator

/botio-linux preview

@pdfjsbot
Copy link

pdfjsbot commented Jan 5, 2022

From: Bot.io (Linux m4)


Received

Command cmd_preview from @Snuffleupagus received. Current queue size: 0

Live output at: http://54.241.84.105:8877/634a43db92b4c08/output.txt

@pdfjsbot
Copy link

pdfjsbot commented Jan 5, 2022

From: Bot.io (Linux m4)


Success

Full output at http://54.241.84.105:8877/634a43db92b4c08/output.txt

Total script time: 4.45 mins

Published

@Snuffleupagus Snuffleupagus linked an issue Jan 5, 2022 that may be closed by this pull request
@Snuffleupagus Snuffleupagus merged commit 290cbc5 into mozilla:master Jan 5, 2022
@Snuffleupagus
Copy link
Collaborator

/botio makeref

@pdfjsbot
Copy link

pdfjsbot commented Jan 5, 2022

From: Bot.io (Linux m4)


Received

Command cmd_makeref from @Snuffleupagus received. Current queue size: 0

Live output at: http://54.241.84.105:8877/626a43116c9737c/output.txt

@pdfjsbot
Copy link

pdfjsbot commented Jan 5, 2022

From: Bot.io (Windows)


Received

Command cmd_makeref from @Snuffleupagus received. Current queue size: 1

Live output at: http://54.193.163.58:8877/ac6ee723dcf9a81/output.txt

@pdfjsbot
Copy link

pdfjsbot commented Jan 5, 2022

From: Bot.io (Linux m4)


Success

Full output at http://54.241.84.105:8877/626a43116c9737c/output.txt

Total script time: 19.99 mins

  • Lint: Passed
  • Make references: Passed
  • Check references: Passed

@pdfjsbot
Copy link

pdfjsbot commented Jan 5, 2022

From: Bot.io (Windows)


Success

Full output at http://54.193.163.58:8877/ac6ee723dcf9a81/output.txt

Total script time: 38.78 mins

  • Lint: Passed
  • Make references: Passed
  • Check references: Passed

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

Successfully merging this pull request may close these issues.

Text layer not well positioned on rotated page by 180
3 participants