Bug 102356 - Arthur backend uses incorrect miter join style
Summary: Arthur backend uses incorrect miter join style
Status: RESOLVED FIXED
Alias: None
Product: poppler
Classification: Unclassified
Component: arthur backend (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: poppler-bugs
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-08-22 09:38 UTC by oliver.sander
Modified: 2017-08-22 21:00 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
pdf file to trigger the bug (1.38 KB, application/pdf)
2017-08-22 09:38 UTC, oliver.sander
Details
The file as rendered by the Splash backend (25.72 KB, image/png)
2017-08-22 09:38 UTC, oliver.sander
Details
The file as rendered by the Arthur backend (29.73 KB, image/png)
2017-08-22 09:39 UTC, oliver.sander
Details
Patch to use the correct join style (1.20 KB, patch)
2017-08-22 09:49 UTC, oliver.sander
Details | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description oliver.sander 2017-08-22 09:38:06 UTC
Created attachment 133666 [details]
pdf file to trigger the bug

The Arthur render backend implements the 'Miter' line join style incorrectly.  You can see this with the attached test file.  It contains a polygon with two corners positioned such that the miter limit is exceeded.  The pdf standard requires that in such a case, the miter join is converted to a bevel join:

  http://www.verypdf.com/document/pdf-format-reference/pg_0217.htm

The Arthur backend, however, simply shortens the miter a little bit.  This results in the spike that can be seen on the screenshot.
Comment 1 oliver.sander 2017-08-22 09:38:46 UTC
Created attachment 133667 [details]
The file as rendered by the Splash backend
Comment 2 oliver.sander 2017-08-22 09:39:23 UTC
Created attachment 133668 [details]
The file as rendered by the Arthur backend
Comment 3 oliver.sander 2017-08-22 09:48:58 UTC
The fix is to use Qt::SvgMiterJoin instead of Qt::MiterJoin.  It is recommended in

  https://bugreports.qt.io/browse/QTBUG-52640

and does indeed fix the problem.  I'll attach a patch.
Comment 4 oliver.sander 2017-08-22 09:49:38 UTC
Created attachment 133669 [details] [review]
Patch to use the correct join style
Comment 5 Albert Astals Cid 2017-08-22 21:00:24 UTC
Pushed


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.