Etienne-Gautier opened a new pull request, #162: URL: https://github.com/apache/pdfbox/pull/162
I am seeing a case of division by `0f` (producing a NaN) when trying to evaluate a gradient with a specific type 3 color function. I believe pdfbox isn't complying with the following sentence in the spec for functionType 3 (see section 3.9 - page 175 of the PDF reference version 1.7). Please see the reference for context, as this sentence alone is rather cryptic > If the last bound, Bounds<sub>k−2</sub>, is equal to Domain<sub>1</sub>, then x′ is defined to be Encode<sub>2i</sub>. Here is a simple PDF that reproduces the error: [gradient-bug.pdf](https://github.com/apache/pdfbox/files/11350511/gradient-bug.pdf) In that example, the type3 color function has 3 sub functions and the following parameters: Bounds = [0.00188385, 1] Domain = [0, 1] Encode = [0, 1, 0, 1, 0, 1] When trying to evaluate the `interpolate` function at `x = 1.0` with the following parameters, we get a NaN   Let me know if I can help further -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org For additional commands, e-mail: dev-h...@pdfbox.apache.org