Image functions problems

Hi,

In some cases in the latest Lucee update the image function do not work anymore. They give a
Could not initialize class com.adobe.xmp.impl.XMPMetaParser error, downgrading does not help.

Regards,

Dick Goosen

Stacktrace:

lucee.runtime.exp.NativeException: Could not initialize class com.adobe.xmp.impl.XMPMetaParser
at com.adobe.xmp.XMPMetaFactory.parseFromBuffer(XMPMetaFactory.java:160)
at com.adobe.xmp.XMPMetaFactory.parseFromBuffer(XMPMetaFactory.java:144)
at com.drew.metadata.xmp.XmpReader.extract(XmpReader.java:116)
at com.drew.metadata.xmp.XmpReader.readJpegSegments(XmpReader.java:102)
at com.drew.imaging.jpeg.JpegMetadataReader.processJpegSegmentData(JpegMetadataReader.java:126)
at com.drew.imaging.jpeg.JpegMetadataReader.process(JpegMetadataReader.java:118)
at com.drew.imaging.jpeg.JpegMetadataReader.readMetadata(JpegMetadataReader.java:69)
at com.drew.imaging.jpeg.JpegMetadataReader.readMetadata(JpegMetadataReader.java:76)
at org.lucee.extension.image.ImageMetaDrew.jpg(ImageMetaDrew.java:60)
at org.lucee.extension.image.ImageMetaDrew.addInfo(ImageMetaDrew.java:51)
at org.lucee.extension.image.Image.info(Image.java:329)
at org.lucee.extension.image.Image._info(Image.java:1703)
at org.lucee.extension.image.Image.valueIterator(Image.java:1810)
at lucee.runtime.reflection.Reflector._clean(Reflector.java:581)
at lucee.runtime.reflection.Reflector._clean(Reflector.java:569)
at lucee.runtime.reflection.Reflector.cleanArgs(Reflector.java:552)
at lucee.runtime.reflection.Reflector.getMethodInstanceEL(Reflector.java:488)
at lucee.runtime.reflection.Reflector.getSetter(Reflector.java:1057)
at lucee.runtime.tag.TagUtil.setAttribute(TagUtil.java:178)
at lucee.runtime.tag.TagUtil.setAttribute(TagUtil.java:174)
at app.cfc.add_property_cfc$cf.udfCall1(/app/cfc/add_property.cfc:483)
at app.cfc.add_property_cfc$cf.udfCall(/app/cfc/add_property.cfc)
at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:107)
at lucee.runtime.type.UDFImpl._call(UDFImpl.java:357)
at lucee.runtime.type.UDFImpl.callWithNamedValues(UDFImpl.java:212)
at lucee.runtime.ComponentImpl._call(ComponentImpl.java:695)
at lucee.runtime.ComponentImpl._call(ComponentImpl.java:573)
at lucee.runtime.ComponentImpl.callWithNamedValues(ComponentImpl.java:2010)
at lucee.runtime.tag.Invoke.doComponent(Invoke.java:221)
at lucee.runtime.tag.Invoke.doEndTag(Invoke.java:194)
at test_cfm$cf.call(/test.cfm:13)
at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:931)
at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:821)
at lucee.runtime.listener.ModernAppListener._onRequest(ModernAppListener.java:225)
at lucee.runtime.listener.MixedAppListener.onRequest(MixedAppListener.java:43)
at lucee.runtime.PageContextImpl.execute(PageContextImpl.java:2462)
at lucee.runtime.PageContextImpl._execute(PageContextImpl.java:2452)
at lucee.runtime.PageContextImpl.executeCFML(PageContextImpl.java:2425)
at lucee.runtime.engine.Request.exe(Request.java:44)
at lucee.runtime.engine.CFMLEngineImpl._service(CFMLEngineImpl.java:1091)
at lucee.runtime.engine.CFMLEngineImpl.serviceCFML(CFMLEngineImpl.java:1039)
at lucee.loader.engine.CFMLEngineWrapper.serviceCFML(CFMLEngineWrapper.java:102)
at lucee.loader.servlet.CFMLServlet.service(CFMLServlet.java:62)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:292)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:528)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1099)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:672)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1520)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1476)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NoClassDefFoundError: Could not initialize class com.adobe.xmp.impl.XMPMetaParser
… 64 more

What versions? Did you try 5.2.9? Lucee 5.3 moved image to an extension and might have changed something.

Downgrading does not work. Things started when updating to latest Lucee. Currently I use Lucee 5.2.8.50.

Regards,

are you able to reproduce it, or does it only happen randomly?

I’ve seen Lucee image functions choke on some JPGs occasionally. I always suspected a problem with some meta data, but never really verified this, since it was used in an internal chunk of code only, and the quickest fix was to re-save the JPG with a non-Adobe tool.
I have definitely seen this behavior since Lucee 5.1, maybe even before.

Are they CMYK images? Plz vote for this issue :slight_smile:

https://luceeserver.atlassian.net/browse/LDEV-1388

I am able to reproduce it, but it happens only with certain jpg images, this image to be more specific was resized (smaller) with Picasa.

Hi, if I resaved the image wuth the error with Adobe Photoshop and I still I get the error. If I resave the image with Sketch I do not get the error and it uploads fine.

The image is RGB, 8 bits channel.

On my local machine Lucee 5.0.0.235-RC no problem with the same image which gives the error on the live server.

Can you file a bug in jira with the reproducible test case?

had a similar problem and created a bug here

https://luceeserver.atlassian.net/browse/LDEV-2258

the reason a downgrade does not work is that the image extension remains, you only downgrade the core, the extension stays.
you need to uninstall the extension.

1 Like

Uninstall which extension? And can I still do image transformations, uploads, etc. afterwards?

Again I narrowed it down to the imageNew function

<cfset cfImage = imageNew(“someFile”)>

gives the

Could not initialize class com.adobe.xmp.impl.XMPMetaParser

error.

Again the workaround is to use the cffile readbinary tag. Think this is up to now the most reliable tag when working with images.

You need to download and re-install the older version of the image-extension afterwards.
https://download.lucee.org/

I had the very same issue. That was a mess.

Regards
Michael

given all these problems users have been experiencing, there needs to be a better solution

there is a minversion in the build.properties file

It doesn’t seem this ever gets checked / enforced / warned?

i.e under the server admin

  • on the update page, when an older version is selected to downgrade to, check the installed extensions and warn about any potential incompatibilities
  • on the applications page (i.e. extensions) show a INCOMPATIBLE banner, like the UPDATE ME (obviously that is only going to be useful once it’s implemented, i.e. older Lucee versions will still have the problem)

bug filed, please vote for it [LDEV-2264] - Lucee