Skip to content

Refactor annotation rectangle code and add unit tests - #6239

Merged
Snuffleupagus merged 1 commit into
mozilla:masterfrom
timvandermeij:annotation-rectangle
Jul 20, 2015
Merged

Snuffleupagus merged 1 commit into
mozilla:masterfrom
timvandermeij:annotation-rectangle

Conversation

@timvandermeij

Copy link
Copy Markdown
Collaborator

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
Copy Markdown
Collaborator Author

/botio-linux preview

@pdfjsbot

Copy link
Copy Markdown

@timvandermeij

Copy link
Copy Markdown
Collaborator Author

/botio test

@pdfjsbot

Copy link
Copy Markdown

@pdfjsbot

Copy link
Copy Markdown

@pdfjsbot

Copy link
Copy Markdown

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
Copy Markdown

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
Copy Markdown
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 added a commit to gayanMatch/convert-pdf-json that referenced this pull request Jun 10, 2023
modesty pushed a commit to modesty/pdf2json that referenced this pull request Nov 10, 2023
dark-knjn added a commit to dark-knjn/convert-pdf-json that referenced this pull request Jul 18, 2024
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.

3 participants