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

Refactor annotation rectangle code and add unit tests #6239

Merged
merged 1 commit into from Jul 20, 2015

Conversation

timvandermeij
Copy link
Contributor

This patch refactors the code responsible for setting the annotation's rectangle. Its goal is to:

  • Actually check that the input array is an array, and if so, that it contains exactly four elements.
  • Only call normalizeRect if the input array is valid, i.e., we do not call it for the default rectangle anymore.
  • Provide unit test coverage (just like the other patches in this series).

@Snuffleupagus Could you review this one? I have tested this patch manually (aside from with the unit tests) with 15 PDF files with different annotation types (Link, Text, Widget, FileAttachment, et cetera) to make sure that the rendering is identical before and after the patch.

This patch refactors the code responsible for setting the annotation's rectangle. Its goal is to:

- Actually check that the input array is actually an array, and if so, that it contains exactly four elements.
- Only call `normalizeRect` if the input array is valid, i.e., we do not call it for the default rectangle anymore.

Unit tests are provided just like with the other patches in this series.
@timvandermeij
Copy link
Contributor Author

/botio-linux preview

@pdfjsbot
Copy link

From: Bot.io (Linux)


Received

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

Live output at: http://107.21.233.14:8877/20cc73d11341eb6/output.txt

@timvandermeij
Copy link
Contributor Author

/botio test

@pdfjsbot
Copy link

From: Bot.io (Linux)


Received

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

Live output at: http://107.21.233.14:8877/4816199e6f98eb5/output.txt

@pdfjsbot
Copy link

From: Bot.io (Windows)


Received

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

Live output at: http://107.22.172.223:8877/ac13484e2a71470/output.txt

@pdfjsbot
Copy link

From: Bot.io (Windows)


Success

Full output at http://107.22.172.223:8877/ac13484e2a71470/output.txt

Total script time: 18.61 mins

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

@pdfjsbot
Copy link

From: Bot.io (Linux)


Success

Full output at http://107.21.233.14:8877/4816199e6f98eb5/output.txt

Total script time: 18.70 mins

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

Snuffleupagus added a commit that referenced this pull request Jul 20, 2015
Refactor annotation rectangle code and add unit tests
@Snuffleupagus Snuffleupagus merged commit 8623421 into mozilla:master Jul 20, 2015
@Snuffleupagus
Copy link
Collaborator

Looks good, thank you!

@timvandermeij timvandermeij deleted the annotation-rectangle branch July 20, 2015 21:30
zzeleznick added a commit to zzeleznick/pdf2json that referenced this pull request Mar 10, 2023
gayanMatch pushed a commit to gayanMatch/convert-pdf-json that referenced this pull request Jun 10, 2023
TadekDev added a commit to TadekDev/Pdf2Json that referenced this pull request Oct 24, 2023
modesty pushed a commit to modesty/pdf2json that referenced this pull request Nov 10, 2023
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.

None yet

3 participants