Uploaded image for project: 'Lucee Development'
  1. LDEV-1385

java.lang.NullPointerException error on cfpdf action="addwatermark"

    Details

    • Type: Bug
    • Status: Deployed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 5.2.1.9
    • Fix Version/s: 5.2.4.6
    • Labels:
      None
    • Environment:

      Windows 10 (64-bit)
      Lucee 5.2.1.9
      Nginx 1.12.0

    • Sprint:
      August 2017 Sprint

      Description

      <cfpdf action="addwatermark" source="#source#" image="#image#" destination="#destination#" overwrite="yes">

      throws an error "java.lang.NullPointerException" with following stacktrace:

      lucee.runtime.exp.NativeException: java.lang.NullPointerException
      at lucee.runtime.exp.NativeException.newInstance(NativeException.java:73)
      at lucee.runtime.op.Caster.toPageException(Caster.java:3201)
      at lucee.runtime.op.Caster.toPageException(Caster.java:3176)
      at lucee.runtime.op.CastImpl.toPageException(CastImpl.java:701)
      at org.lucee.extension.pdf.tag.PDF.doEndTag(PDF.java:693)
      at miscellaneous.pdf_cfm$cf.call(/miscellaneous/pdf.cfm:7)
      at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:897)
      at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:842)
      at lucee.runtime.listener.ModernAppListener._onRequest(ModernAppListener.java:224)
      at lucee.runtime.listener.MixedAppListener.onRequest(MixedAppListener.java:43)
      at lucee.runtime.PageContextImpl.execute(PageContextImpl.java:2408)
      at lucee.runtime.PageContextImpl._execute(PageContextImpl.java:2398)
      at lucee.runtime.PageContextImpl.executeCFML(PageContextImpl.java:2366)
      at lucee.runtime.engine.Request.run(Request.java:34)

      Both "source" (pdf) and "image" (tiff or png) files are in place with correct content, actually working perfectly with Lucee 4.5

      I am no expert in underlying PDF library, but one change in PDF.java (while comparing v4 vs v5) look suspicious (apart from few changes in variables references):

      was
      >> img=Image.getInstance(PDFUtil.toImage(barr, 1).getBufferedImage(),null,false);

      now
      >> img=Image.getInstance(PDFUtil.toImage(barr, 1),null,false);

      Anyway, please help with original issue!

        Attachments

          Activity

            People

            • Assignee:
              michaeloffner Michael Offner
              Reporter:
              dmitry Dmitry Yakhnov
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: