Skip to content

Commit

Permalink
Merge pull request #15013 from Snuffleupagus/issue-15012
Browse files Browse the repository at this point in the history
Render PopupAnnotations even if they have missing or empty /Rect-entries (issue 15012, PR 14439 follow-up)
  • Loading branch information
Snuffleupagus authored Jun 9, 2022
2 parents a1bc5a8 + 6371a76 commit 1eaef66
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
run: npm install -g gulp-cli

- name: Install other dependencies
run: npm install
run: npm install -f

- name: Run tests
run: gulp ci-test
8 changes: 4 additions & 4 deletions src/display/annotation_layer.js
Original file line number Diff line number Diff line change
Expand Up @@ -2410,14 +2410,14 @@ class AnnotationLayer {
if (!data) {
continue;
}
const { width, height } = getRectDims(data.rect);
if (width <= 0 || height <= 0) {
continue;
}
if (data.annotationType === AnnotationType.POPUP) {
popupAnnotations.push(data);
continue;
}
const { width, height } = getRectDims(data.rect);
if (width <= 0 || height <= 0) {
continue; // Ignore empty annotations.
}
sortedAnnotations.push(data);
}
if (popupAnnotations.length) {
Expand Down
1 change: 1 addition & 0 deletions test/pdfs/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,7 @@
!xfa_issue14315.pdf
!poppler-67295-0.pdf
!poppler-85140-0.pdf
!issue15012.pdf
!poppler-395-0-fuzzed.pdf
!GHOSTSCRIPT-698804-1-fuzzed.pdf
!issue14814.pdf
Expand Down
Binary file added test/pdfs/issue15012.pdf
Binary file not shown.
7 changes: 7 additions & 0 deletions test/test_manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -4951,6 +4951,13 @@
"type": "eq",
"forms": true
},
{ "id": "issue15012",
"file": "pdfs/issue15012.pdf",
"md5": "cc5e89507262cb3ec6862f68cb3eefd1",
"rounds": 1,
"type": "eq",
"annotations": true
},
{ "id": "gesamt",
"file": "pdfs/gesamt.pdf",
"md5": "743aaa6f46ed0a42864f079d632d942e",
Expand Down

0 comments on commit 1eaef66

Please sign in to comment.