Hi there, happy to land here and happy to use Lucee for the first time, was a hell of a journey to setup my first linux server. And it was worth it, my app got a gain of like 3000% for some of the calculations involved (images manipulations).
But while porting the app,from ACF to LCF, I encountered an issue I’m struggling with:
<cfset myImage=ImageNew(arguments.backgroundImage)>
<cfset ImageResize(myImage,33,33,'highestQuality',1)> --> OK!
<cfset drawnzone = ImageCopy(myImage,qr.x+arguments.w,qr.y+arguments.w,qr.w,qr.w)>
<cfset ImageResize(drawnzone,33,33,'highestQuality',1)> --> ERROR
I import in a function a PNG image → MyImage is set with it
If I try resizing it, no issues.
Then I’m able to extract a rectangle of it in ‘drawzone’. dumping it shows the very same information for both ‘in memory’ pictures except of course firn height and width. And both images display properly in the dump.
But if I try to apply the same resizing line to the ‘copy’, I get this:
Lucee 5.3.2.77 Error (java.lang.IllegalArgumentException)
Message Unknown image type 0
Stacktrace The Error Occurred in
/var/www/html/qrcodebox/qrcode.cfc: line 274
272: <cfdump var="#ImageInfo(drawnzone)#">
273: </cfoutput>
274: <cfset ImageResize(drawnzone,arraylen(rows)*1,arraylen(rows)*1,'nearest',1)> <cfabort>
275: <!--- MODERATE ACCURACY OF THE DETECTION WITH AN ImagePaste --->
276: <cfset ImageResize(drawnzone2,arraylen(rows)*1,arraylen(rows)*1,'highestQuality',1)>
Java Stacktrace lucee.runtime.exp.NativeException: Unknown image type 0
at java.desktop/java.awt.image.BufferedImage.(BufferedImage.java:501)
at org.lucee.extension.image.Image.resizeImage(Image.java:1271)
at org.lucee.extension.image.Image.resize(Image.java:1314)
at org.lucee.extension.image.Image.resize(Image.java:1257)
at org.lucee.extension.image.functions.ImageResize.call(ImageResize.java:63)
at org.lucee.extension.image.functions.ImageResize.invoke(ImageResize.java:69)
at lucee.runtime.functions.FunctionHandlerPool.invoke(FunctionHandlerPool.java:39)
at qrcode_cfc$cf.udfCall(/qrcode.cfc:274)
at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:106)
at lucee.runtime.type.UDFImpl._call(UDFImpl.java:342)
at lucee.runtime.type.UDFImpl.callWithNamedValues(UDFImpl.java:205)
at lucee.runtime.ComponentImpl._call(ComponentImpl.java:683)
at lucee.runtime.ComponentImpl._call(ComponentImpl.java:578)
at lucee.runtime.ComponentImpl.callWithNamedValues(ComponentImpl.java:1946)
at lucee.runtime.ComponentSpecificAccess.callWithNamedValues(ComponentSpecificAccess.java:156)
at lucee.runtime.ComponentPageImpl.callWDDX(ComponentPageImpl.java:629)
at lucee.runtime.ComponentPageImpl.call(ComponentPageImpl.java:189)
at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:942)
at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:834)
at lucee.runtime.listener.ClassicAppListener._onRequest(ClassicAppListener.java:64)
at lucee.runtime.listener.MixedAppListener.onRequest(MixedAppListener.java:43)
at lucee.runtime.PageContextImpl.execute(PageContextImpl.java:2409)
at lucee.runtime.PageContextImpl._execute(PageContextImpl.java:2399)
at lucee.runtime.PageContextImpl.executeCFML(PageContextImpl.java:2374)
at lucee.runtime.engine.Request.exe(Request.java:43)
at lucee.runtime.engine.CFMLEngineImpl._service(CFMLEngineImpl.java:1037)
at lucee.runtime.engine.CFMLEngineImpl.serviceCFML(CFMLEngineImpl.java:983)
at lucee.loader.engine.CFMLEngineWrapper.serviceCFML(CFMLEngineWrapper.java:97)
at lucee.loader.servlet.CFMLServlet.service(CFMLServlet.java:51)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:200)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:490)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:836)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1839)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.lang.IllegalArgumentException: Unknown image type 0
... 51 more
Timestamp 8/7/19 11:54:42 PM UTC
I read in many places that this bug (?) persist in the java library but found no workaround for LCF. Any idea (I could save and reload the picture but that goes against the idea of solving the issue and also it definitly goes against the great performance
Thanks!