I have created a new MultimediaComponent and uploaded a SVG image to it. When using this MultimediaComponent in a Component and publish it to my page, the image wont be displayed.
A nullpointer happens in the image resize function at:
int sourceW = originalImage.getWidth();
Width and height of a SVG image are not filled because it has no defined width and height - its scale-able. Therefor i think it cant be resized by that function anyways.
So my question is: Is is possible to still use SVG images without changing DXA code? Is there maybe an option to turn the resize feature off completely?
Thank you!
Stack trace if anyone is interested:
ERROR c.s.w.c.controller.PageController - Exception while processing request for: /en/images/logo_tcm1206-369286_w1024_n.svg
java.lang.NullPointerException: null
at com.sdl.webapp.common.util.ImageUtils.resizeImage(ImageUtils.java:30)
at com.sdl.webapp.common.util.ImageUtils.writeToFile(ImageUtils.java:105)
at com.sdl.webapp.tridion.mapping.DefaultContentProvider.getStaticContentFile(DefaultContentProvider.java:95)
at com.sdl.webapp.tridion.mapping.AbstractDefaultContentProvider.getStaticContentFile(AbstractDefaultContentProvider.java:366)
at com.sdl.webapp.tridion.mapping.AbstractDefaultContentProvider.getStaticContent(AbstractDefaultContentProvider.java:309)
at com.sdl.webapp.common.impl.interceptor.StaticContentInterceptor.preHandle(StaticContentInterceptor.java:109)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:914)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:852)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882)
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:778)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:622)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
PS: I did also create a ticket in DXA Java GitHub.