java – 自JRE 1.7.0_25以来,Batik在转换时失败

自从我更新到JRE 1.7.0_25后,batik在应用转换时抛出异常.

堆栈跟踪是:

java.awt.image.ImagingOpException: Unable to transform src image
at java.awt.image.AffineTransformOp.filter(Unknown Source)
at org.apache.batik.ext.awt.image.rendered.AffineRed.genRect(AffineRed.java:193)
at org.apache.batik.ext.awt.image.rendered.AffineRed.copyData(AffineRed.java:109)
at org.apache.batik.ext.awt.image.rendered.PadRed.copyData(PadRed.java:88)
at org.apache.batik.ext.awt.image.rendered.PadRed.copyData(PadRed.java:88)
at org.apache.batik.ext.awt.image.rendered.Any2sRGBRed.copyData(Any2sRGBRed.java:166)
at org.apache.batik.ext.awt.image.rendered.AbstractRed.getData(AbstractRed.java:526)
at org.apache.batik.ext.awt.image.GraphicsUtil.drawImage(GraphicsUtil.java:264)
at org.apache.batik.ext.awt.image.GraphicsUtil.drawImage(GraphicsUtil.java:455)
at org.apache.batik.gvt.AbstractGraphicsNode.paint(AbstractGraphicsNode.java:549)
at org.apache.batik.gvt.ShapeNode.paint(ShapeNode.java:143)
at org.apache.batik.gvt.CompositeGraphicsNode.primitivePaint(CompositeGraphicsNode.java:165)
at org.apache.batik.gvt.AbstractGraphicsNode.paint(AbstractGraphicsNode.java:509)
at org.apache.batik.gvt.CompositeGraphicsNode.primitivePaint(CompositeGraphicsNode.java:165)
at org.apache.batik.gvt.filter.GraphicsNodeRed8Bit.genRect(GraphicsNodeRed8Bit.java:140)
at org.apache.batik.gvt.filter.GraphicsNodeRed8Bit.copyData(GraphicsNodeRed8Bit.java:116)
at org.apache.batik.ext.awt.image.rendered.PadRed.copyData(PadRed.java:88)
at org.apache.batik.ext.awt.image.rendered.Any2LsRGBRed.copyData(Any2LsRGBRed.java:109)
at org.apache.batik.ext.awt.image.rendered.AbstractRed.getData(AbstractRed.java:526)
at org.apache.batik.ext.awt.image.rendered.CompositeRed.genRect(CompositeRed.java:188)
at org.apache.batik.ext.awt.image.rendered.CompositeRed.copyData(CompositeRed.java:139)
at org.apache.batik.ext.awt.image.rendered.Any2sRGBRed.copyData(Any2sRGBRed.java:166)
at org.apache.batik.ext.awt.image.GraphicsUtil.drawImage(GraphicsUtil.java:347)
at org.apache.batik.ext.awt.image.GraphicsUtil.drawImage(GraphicsUtil.java:455)
at org.apache.batik.ext.awt.image.renderable.PadRable8Bit.paintRable(PadRable8Bit.java:135)
at org.apache.batik.ext.awt.image.GraphicsUtil.drawImage(GraphicsUtil.java:440)
at org.apache.batik.ext.awt.image.renderable.PadRable8Bit.paintRable(PadRable8Bit.java:135)
at org.apache.batik.ext.awt.image.GraphicsUtil.drawImage(GraphicsUtil.java:440)
at org.apache.batik.ext.awt.image.renderable.FilterChainRable8Bit.paintRable(FilterChainRable8Bit.java:251)
at org.apache.batik.ext.awt.image.GraphicsUtil.drawImage(GraphicsUtil.java:440)
at org.apache.batik.gvt.AbstractGraphicsNode.paint(AbstractGraphicsNode.java:549)
at org.apache.batik.gvt.CompositeGraphicsNode.primitivePaint(CompositeGraphicsNode.java:165)
at org.apache.batik.gvt.AbstractGraphicsNode.paint(AbstractGraphicsNode.java:509)
at org.apache.batik.gvt.CompositeGraphicsNode.primitivePaint(CompositeGraphicsNode.java:165)
at org.apache.batik.gvt.CanvasGraphicsNode.primitivePaint(CanvasGraphicsNode.java:159)
at org.apache.batik.gvt.AbstractGraphicsNode.paint(AbstractGraphicsNode.java:509)
at org.apache.batik.gvt.CompositeGraphicsNode.primitivePaint(CompositeGraphicsNode.java:165)
at org.apache.batik.gvt.filter.GraphicsNodeRed8Bit.genRect(GraphicsNodeRed8Bit.java:140)
at org.apache.batik.gvt.filter.GraphicsNodeRed8Bit.copyData(GraphicsNodeRed8Bit.java:116)
at org.apache.batik.ext.awt.image.rendered.TranslateRed.copyData(TranslateRed.java:105)
at org.apache.batik.gvt.renderer.DynamicRenderer.repaint(DynamicRenderer.java:244)
at org.apache.batik.gvt.renderer.StaticRenderer.repaint(StaticRenderer.java:344)
at org.apache.batik.swing.gvt.GVTTreeRenderer.run(GVTTreeRenderer.java:123)

异常在this line in AffineRed.java抛出.

有没有人如何解决这个问题,或者这是JRE中的临时错误?

解决方法:

这是Java 7 Update 25中的一个regression.加剧了,Oracle看起来会推迟将回归的修复延迟到更新60.它不像任何人依赖Java来做任何事情.谢谢,甲骨文!

有关如何避免此问题,请在this post中从Batik邮件列表中进行简要说明:

The only workaround I have been able to find so far is patching BATIK
sources to no longer call BufferedImageOp.filter directly on the source
and destination image, but to filter two ARGB BufferedImage copies.

遗憾的是,这意味着如果它们不是ARGB,则必须复制源图像和目标图像.

上一篇:Vue-cli3 引入Element-ui


下一篇:用vue-cli3搭建vue项目