radial gradients rendering
Submitted by mic..@..tum.de
Assigned to poppler-bugs
Created attachment 120150 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.
Attachment 120150, "uncompressed pdf with radial gradient":