Bug 93129 - radial gradients rendering
Summary: radial gradients rendering
Alias: None
Product: poppler
Classification: Unclassified
Component: cairo backend (show other bugs)
Version: unspecified
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: poppler-bugs
QA Contact:
Depends on:
Reported: 2015-11-26 16:14 UTC by michael.leitner
Modified: 2018-08-20 22:01 UTC (History)
0 users

See Also:
i915 platform:
i915 features:

uncompressed pdf with radial gradient (2.92 KB, text/plain)
2015-11-26 16:14 UTC, michael.leitner

Description michael.leitner 2015-11-26 16:14:15 UTC
Created attachment 120150 [details]
uncompressed pdf with radial gradient

I notice that using evince/atril through a number of versions, corresponding to libpoppler versions 0.18 through 0.33, the gradients as in the attached pdf do not render properly. 
The pdf specifications allow radial gradients, that essentially consist of linearly interpolating between a start and an end circle (with different positions and radii). According to my incomplete tests, if start and end circle have exactly the same radii, everything works correctly. Also, if the end circle is smaller than the start circle and the distances of the centers of the circles is not too large, it works. However, if the end circle is only slightly smaller than the start circle and/or the distance is larger, it seems as if the interpolation goes in the wrong direction: the position of the end circle is flipped through the center of the start circle, its radius is larger (and not smaller), and the colors used for drawing the intermediate circles are all the start color of the gradient. In the attached example you can play around with the last number on line 67, you will see that at precisely 50 the error occurs (though this thresholds depends on the relative positions of the circles). 
Tests on a number of other pdf viewers not using poppler all render fine. However, I am not sure whether poppler itself (via its invocation of cairo) or cairo has the bug: using poppler-utils' pdftoppm works okay, while pdftocairo renders incorrect pngs, and using it to convert pdf to pdf produces pdfs that do not render correctly on any viewer.
Comment 1 GitLab Migration User 2018-08-20 22:01:39 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/poppler/poppler/issues/163.

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.