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

[Tracking] SMask regressions from PR 4161 #7011

Closed
4 of 5 tasks
Snuffleupagus opened this issue Feb 20, 2016 · 6 comments
Closed
4 of 5 tasks

[Tracking] SMask regressions from PR 4161 #7011

Snuffleupagus opened this issue Feb 20, 2016 · 6 comments
Labels

Comments

@Snuffleupagus
Copy link
Collaborator

Snuffleupagus commented Feb 20, 2016

This issue is intended to help track various SMask related regressions from PR #4161.

  • Issue 6165 - Bad render of sec-guide-to-proxy-brochures
  • Issue 6967 - Image in PDF doesn't load
  • Issue 7143 - Some images are not rendered correctly/at all
  • Bug 852992 - [PDF Viewer] Image pattern not rendered
  • Bug 1199237 - Wrong rendering by the FF built-in viewer of a PDF file correctly rendered with external PDF viewers

Note: This is a tracking bug, please do not post unrelated comments here!

@Snuffleupagus
Copy link
Collaborator Author

The problem with all of the PDF files in the referenced issues/bugs is that they are fairly complex, thus making debugging much more difficult.
Hence I've tried to create a reduced test-case, see below, by manually removing/simplifying as much as possible in one of the PDF files (I hope that it still exhibits the same problem as the original file).

bug852992_reduced.pdf

@yurydelendik
Copy link
Contributor

I hope that it still exhibits the same problem as the original file.
bug852992_reduced.pdf

It does not. But I have a fix for this particular case:

diff --git a/src/display/canvas.js b/src/display/canvas.js
index 5df5a73..4a04acc 100644
--- a/src/display/canvas.js
+++ b/src/display/canvas.js
@@ -869,6 +869,11 @@ var CanvasGraphics = (function CanvasGraphicsClosure() {
     },

     endDrawing: function CanvasGraphics_endDrawing() {
+      // Finishing all opened operations such as SMask group painting.
+      if (this.current.activeSMask !== null) {
+        this.endSMaskGroup();
+      }
+
       this.ctx.restore();

       if (this.transparentCanvas) {

@yurydelendik
Copy link
Contributor

#6967 is a weird one and looks like PDF.js is doing a right thing (?): mask is painted outside of page and when applied it hides the content painted on the page/

@yurydelendik
Copy link
Contributor

Bug 852992 contains two different issues, addressing the regression only

@yurydelendik
Copy link
Contributor

Let's keep Bug 852992 as unaddressed since http://martin.von-gagern.net/publications/2008-diploma/Diplomarbeit.pdf p.74 shows similar problem as Issue 6967 (btw, Max OS X Preview as issue with showing this page too)

@timvandermeij
Copy link
Contributor

Closing since the mentioned problems are either fixed, won't-fix or have a dedicated issue, so there is no need for this tracking issue anymore.

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

No branches or pull requests

3 participants