ICEpdf
  1. ICEpdf
  2. PDF-729

Not a number (NaN) error when calculating function 2 result

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 5.0.5
    • Fix Version/s: 5.0.6
    • Component/s: Core/Parsing
    • Labels:
      None
    • Environment:
      any

      Description

      The forum user posted a PDF file that contains two gradient painted shapes. Both gradients had a section of black toward the middle of the gradient. On closer inspection our type 2 function code was returning an NaN when calculating the three colour values from the 1 digit input.

      The NaN is being caused by Math.pow(-1.6, 1.13) which seem a bit strange to me.

        Activity

        Hide
        Patrick Corless added a comment -

        I've updated the Function_2.java code to avoid having a negative base value and the gradient now appears to paint correctly.

        Show
        Patrick Corless added a comment - I've updated the Function_2.java code to avoid having a negative base value and the gradient now appears to paint correctly.
        Hide
        Patrick Corless added a comment -

        Did some regression testing and the fix appears to be valid.

        Show
        Patrick Corless added a comment - Did some regression testing and the fix appears to be valid.

          People

          • Assignee:
            Patrick Corless
            Reporter:
            Patrick Corless
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: