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

Convert src/core/jpg.js to use the readUint16 helper function in src/core/core_utils.js, rather than re-implementing it twice #11482

Merged
merged 2 commits into from
Jan 25, 2020

Conversation

Snuffleupagus
Copy link
Collaborator

Please refer to the individual commit messages for additional details.

@Snuffleupagus
Copy link
Collaborator Author

/botio-linux test

@pdfjsbot
Copy link

pdfjsbot commented Jan 7, 2020

From: Bot.io (Linux m4)


Received

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

Live output at: http://54.67.70.0:8877/b2b77c6f81b97f2/output.txt

@pdfjsbot
Copy link

pdfjsbot commented Jan 7, 2020

From: Bot.io (Linux m4)


Failed

Full output at http://54.67.70.0:8877/b2b77c6f81b97f2/output.txt

Total script time: 19.00 mins

  • Font tests: Passed
  • Unit tests: Passed
  • Regression tests: FAILED

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

@Snuffleupagus
Copy link
Collaborator Author

There's no images, of any kind, in the failing reference test above.
However, Firefox was just updated to version 73 on the bot and we've seen before that updates can change how non-embedded CJK fonts render.

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Received

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

Live output at: http://54.67.70.0:8877/f5c5966b0d19a5b/output.txt

@pdfjsbot
Copy link

From: Bot.io (Windows)


Received

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

Live output at: http://54.215.176.217:8877/8df3f121e43a543/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Failed

Full output at http://54.67.70.0:8877/f5c5966b0d19a5b/output.txt

Total script time: 19.84 mins

  • Font tests: Passed
  • Unit tests: Passed
  • Regression tests: FAILED

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

@pdfjsbot
Copy link

From: Bot.io (Windows)


Failed

Full output at http://54.215.176.217:8877/8df3f121e43a543/output.txt

Total script time: 60.00 mins

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Received

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

Live output at: http://54.67.70.0:8877/52f9e9deeab15fb/output.txt

@pdfjsbot
Copy link

From: Bot.io (Windows)


Received

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

Live output at: http://54.215.176.217:8877/869052a2ab3f9a1/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Failed

Full output at http://54.67.70.0:8877/52f9e9deeab15fb/output.txt

Total script time: 19.43 mins

  • Font tests: Passed
  • Unit tests: Passed
  • Regression tests: FAILED

Image differences available at: http://54.67.70.0:8877/52f9e9deeab15fb/reftest-analyzer.html#web=eq.log

@pdfjsbot
Copy link

From: Bot.io (Windows)


Failed

Full output at http://54.215.176.217:8877/869052a2ab3f9a1/output.txt

Total script time: 25.81 mins

  • Font tests: Passed
  • Unit tests: Passed
  • Regression tests: FAILED

Image differences available at: http://54.215.176.217:8877/869052a2ab3f9a1/reftest-analyzer.html#web=eq.log

…` and into a `src/core/core_utils.js` instead

This moves the `log2`, `readInt8`, `readUint16`, `readUint32`, and `isSpace` functions since they are only used in the worker-thread.
…`src/core/core_utils.js`, rather than re-implementing it twice

The other image decoders, i.e. the JBIG2 and JPEG 2000 ones, are using the common helper function `readUint16`. Most likely, the only reason that the JPEG decoder is doing it this way is because it originated *outside* of the PDF.js library.
Hence we can simply re-factor `src/core/jpg.js` to use the common `readUint16` helper function, which is especially nice given that the functionality was essentially *duplicated* in the code.
@timvandermeij timvandermeij merged commit 3775b71 into mozilla:master Jan 25, 2020
@timvandermeij
Copy link
Contributor

Nice refactoring!

@Snuffleupagus Snuffleupagus deleted the more-core-utils branch January 25, 2020 21:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants