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

        Patrick Corless created issue -
        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.
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #40438 Thu Mar 27 10:18:34 MDT 2014 patrick.corless PDF-729 fixed NaN return value when encountering a negative input.
        Files Changed
        Commit graph MODIFY /icepdf/branches/icepdf-5.0.1/icepdf/core/src/org/icepdf/core/pobjects/functions/Function_2.java
        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.
        Patrick Corless made changes -
        Field Original Value New Value
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 5.0.6 [ 11381 ]
        Resolution Fixed [ 1 ]
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #40445 Thu Mar 27 12:26:59 MDT 2014 patrick.corless PDF-729 fixed NaN return value when encountering a negative input.
        Files Changed
        Commit graph MODIFY /icepdf/trunk/icepdf/core/src/org/icepdf/core/pobjects/functions/Function_2.java
        Patrick Corless made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

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

            Dates

            • Created:
              Updated:
              Resolved: