PDF - Stitching functions with sampled function that repeats a pattern does not get rendered
This issue was previously raised downstream at gnome - evince: https://gitlab.gnome.org/GNOME/evince/-/issues/1451
Drawing a linear gradient:
background: linear-gradient(red 0%, green 25%, blue 50%, red 50%, green 75%, blue 100%);
The PDF uses stitching functions with sampled functions. The gradient repeats it self, and looks fine on all viewers. However Evince seems to ignore the last 3 sampled functions and only shows half. By changing the color of one of the color sample values by one, Evince is happy again and renders the files as expected.
See attached files and different in line 97 - second last byte.
The issue can be reproduced with poppler's utilities. For example:
% pdftoppm -png 'fails.pdf' -o fails-default % pdftocairo -png 'fails.pdf' -o fails-cairo
Those commands will generate a png each. The first one correctly (splash backend of Poppler), and the second wrongly (cairo backend of Poppler).
Comment by @gpoo