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

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!

Environment

Windows 10 (64-bit)
Lucee 5.2.1.9
Nginx 1.12.0

Assignee

Michael Offner

Reporter

Dmitry Yakhnov

Priority

Critical

Labels

Fix versions

Sprint

None

Affects versions

Configure