trello-archive / victor

Use SVGs as resources in Android
Apache License 2.0
1.01k stars 49 forks source link

The "opacity" property does not support dimension values. #25

Closed IgorGanapolsky closed 9 years ago

IgorGanapolsky commented 9 years ago

Hello, my ci job on Travis-ci keeps failing with this:

:app:mergeDebugAssets:app:mergeDebugAssets Building 44%5% > :app:generateDebugResValues:app:generateDebugResValues Building 45% > :app:rasterizeSvgsForDebug:app:rasterizeSvgsForDebug Building 45% > :app:rasterizeSvgsForDebug Building 45% > :app:rasterizeSvgsForDebug***\ CSSEngine: exception property.syntax.error:org.w3c.dom.DOMException: The "opacity" property does not support dimension values. Building 45% > :app:rasterizeSvgsForDebug Building 45% > :app:rasterizeSvgsForDebugAttrValue:8.000000e-02 Building 45% > :app:rasterizeSvgsForDebug Building 45% > :app:rasterizeSvgsForDebugException:org.w3c.dom.DOMException Building 45% > :app:rasterizeSvgsForDebugorg.w3c.dom.DOMException: The "opacity" property does not support dimension values. Building 45% > :app:rasterizeSvgsForDebug at org.apache.batik.css.engine.value.AbstractValueFactory.createInvalidLexicalUnitDOMException(AbstractValueFactory.java:60) Building 45% > :app:rasterizeSvgsForDebug at org.apache.batik.css.engine.value.svg.OpacityManager.createValue(OpacityManager.java:117) Building 45% > :app:rasterizeSvgsForDebug at org.apache.batik.css.engine.CSSEngine$1.property(CSSEngine.java:744) Building 45% > :app:rasterizeSvgsForDebug at org.apache.batik.css.engine.CSSEngine.getCascadedStyleMap(CSSEngine.java:768) Building 45% > :app:rasterizeSvgsForDebug at org.apache.batik.css.engine.CSSEngine.getComputedStyle(CSSEngine.java:876) Building 45% > :app:rasterizeSvgsForDebug at org.apache.batik.bridge.CSSUtilities.getComputedStyle(CSSUtilities.java:82) Building 45% > :app:rasterizeSvgsForDebug at org.apache.batik.bridge.CSSUtilities.convertDisplay(CSSUtilities.java:564) Building 45% > :app:rasterizeSvgsForDebug at org.apache.batik.bridge.GVTBuilder.buildGraphicsNode(GVTBuilder.java:206) Building 45% > :app:rasterizeSvgsForDebug at org.apache.batik.bridge.GVTBuilder.buildComposite(GVTBuilder.java:171) Building 45% > :app:rasterizeSvgsForDebug at org.apache.batik.bridge.GVTBuilder.buildGraphicsNode(GVTBuilder.java:219) Building 45% > :app:rasterizeSvgsForDebug at org.apache.batik.bridge.GVTBuilder.buildComposite(GVTBuilder.java:171) Building 45% > :app:rasterizeSvgsForDebug at org.apache.batik.bridge.GVTBuilder.build(GVTBuilder.java:82) Building 45% > :app:rasterizeSvgsForDebug at org.apache.batik.transcoder.SVGAbstractTranscoder.transcode(SVGAbstractTranscoder.java:208) Building 45% > :app:rasterizeSvgsForDebug at org.apache.batik.transcoder.image.ImageTranscoder.transcode(ImageTranscoder.java:92) Building 45% > :app:rasterizeSvgsForDebug at org.apache.batik.transcoder.XMLAbstractTranscoder.transcode(XMLAbstractTranscoder.java:142) Building 45% > :app:rasterizeSvgsForDebug at org.apache.batik.transcoder.SVGAbstractTranscoder.transcode(SVGAbstractTranscoder.java:156) Building 45% > :app:rasterizeSvgsForDebug at org.apache.batik.transcoder.Transcoder$transcode$0.call(Unknown Source) Building 45% > :app:rasterizeSvgsForDebug at com.trello.victor.Converter.transcode(Converter.groovy:63) Building 45% > :app:rasterizeSvgsForDebug at com.trello.victor.Converter$transcode.call(Unknown Source) Building 45% > :app:rasterizeSvgsForDebug at com.trello.victor.RasterizeTask$_rasterize_closure3_closure5.doCall(RasterizeTask.groovy:96)

Please explain what I can do to avoid this error?

Thanks, Igor

dlew commented 9 years ago

What's the SVG you're trying to rasterize?

IgorGanapolsky commented 9 years ago

@dlew This one: http://cl.ly/2O1U3Q3l2m0i?_ga=1.232834013.2145686362.1436888762

dlew commented 9 years ago

The rasterizer has a problem with this specifically:

The attribute "opacity" represents an invalid CSS value ("8.000000e-02").

I'm not sure if that's a valid number format or not here, but regardless, this is a problem with the Batik rasterizer (which Victor uses), not Victor itself. You could either fix your SVG (use .08 instead) or you could file a bug with Batik: https://issues.apache.org/jira/browse/BATIK-1029?jql=project%20%3D%20BATIK%20AND%20resolution%20%3D%20Unresolved%20AND%20status%20in%20(Open%2C%20%22In%20Progress%22%2C%20Reopened)%20ORDER%20BY%20priority%20DESC