You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-users@xmlgraphics.apache.org by Sebastien Aurelie <Au...@artesiaservices.be> on 2001/07/02 14:51:10 UTC

JPEGTranscoder or fill3DRect problem ?

Hi !

I paint a chart. For each bar I paint, I use fill3DRect. But it happens
sometimes, that I need to paint a rectangle with a null height. I just have
seen that fill3DRect draws this rectangle (even with a null height), and to
have a 3D effect, it tries to paint a second rectangle with negative height!
Well, no problem occurs for draw it. When a convert this
negative-height-rectangle into svg, still no problem, but if I want to
trancode it into a JPEG image, you can see the following exception.
So, where is the source of the problem? Can we think that fill3DRect need to
test the height of the rectangle before to draw it, or bridge of batik need
to transcode negative height ?


org.apache.batik.bridge.BridgeException:
file:/C:/WINNT/Profiles/ausebast.000/cache/documentInterface42725.svg:0
The attribute 'height' of the element <rect> can not be negative 	
at
org.apache.batik.bridge.UnitProcessor.svgLengthToUserSpace(UnitProcessor.jav
a:344) 	
at
org.apache.batik.bridge.UnitProcessor.svgVerticalLengthToUserSpace(UnitProce
ssor.java:273) 	
at
org.apache.batik.bridge.SVGRectElementBridge.buildShape(SVGRectElementBridge
.java:85) 	
at
org.apache.batik.bridge.SVGShapeElementBridge.createGraphicsNode(SVGShapeEle
mentBridge.java:44) 	
at org.apache.batik.bridge.GVTBuilder.buildGraphicsNode(GVTBuilder.java:170)

at org.apache.batik.bridge.GVTBuilder.buildComposite(GVTBuilder.java:136)

at org.apache.batik.bridge.GVTBuilder.buildGraphicsNode(GVTBuilder.java:176)

at org.apache.batik.bridge.GVTBuilder.buildComposite(GVTBuilder.java:136)

at org.apache.batik.bridge.GVTBuilder.buildGraphicsNode(GVTBuilder.java:176)

at org.apache.batik.bridge.GVTBuilder.buildComposite(GVTBuilder.java:136)

at org.apache.batik.bridge.GVTBuilder.buildGraphicsNode(GVTBuilder.java:176)

at org.apache.batik.bridge.GVTBuilder.buildComposite(GVTBuilder.java:136)

at org.apache.batik.bridge.GVTBuilder.buildGraphicsNode(GVTBuilder.java:176)

at org.apache.batik.bridge.GVTBuilder.buildComposite(GVTBuilder.java:136)

at org.apache.batik.bridge.GVTBuilder.buildGraphicsNode(GVTBuilder.java:176)

at org.apache.batik.bridge.GVTBuilder.buildComposite(GVTBuilder.java:136)

at org.apache.batik.bridge.GVTBuilder.buildGraphicsNode(GVTBuilder.java:176)

at org.apache.batik.bridge.GVTBuilder.buildComposite(GVTBuilder.java:136)

at org.apache.batik.bridge.GVTBuilder.buildGraphicsNode(GVTBuilder.java:176)

at org.apache.batik.bridge.GVTBuilder.buildComposite(GVTBuilder.java:136)

at org.apache.batik.bridge.GVTBuilder.build(GVTBuilder.java:69) 	
at
org.apache.batik.transcoder.image.ImageTranscoder.transcode(ImageTranscoder.
java:155) 	
at
org.apache.batik.transcoder.XMLAbstractTranscoder.transcode(XMLAbstractTrans
coder.java:126) 	
at
com.ft.pcl.service.dc.engine.storyboard.PCLStoryboardEngine.svg2jpeg(PCLStor
yboardEngine.java:255) 	
at
com.ft.pcl.service.dc.engine.storyboard.PCLStoryboardEngine.swing2jpeg(PCLSt
oryboardEngine.java:170) 	
at
com.ft.pcl.service.dc.engine.storyboard.PCLStoryboardEngine.dml2fo(PCLStoryb
oardEngine.java:411) 	
at
com.ft.pcl.service.dc.engine.storyboard.PCLStoryboardEngine.dml2pdf(PCLStory
boardEngine.java:165) 	
at
com.ft.pcl.presentation.net.dialogue.storyboard.PCLNetStoryBoard.actionPerfo
rmed(PCLNetStoryBoard.java:158) 	
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1450)

at
javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButto
n.java:1504) 	
at
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:3
78) 	
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:250)

at
javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener
.java:216) 	
at java.awt.Component.processMouseEvent(Component.java:3715) 	
at java.awt.Component.processEvent(Component.java:3544) 	
at java.awt.Container.processEvent(Container.java:1164) 	
at java.awt.Component.dispatchEventImpl(Component.java:2593) 	
at java.awt.Container.dispatchEventImpl(Container.java:1213) 	
at java.awt.Component.dispatchEvent(Component.java:2497) 	
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2451)

at java.awt.LightweightDispatcher.processMouseEvent(Container.java:2216)

at java.awt.LightweightDispatcher.dispatchEvent(Container.java:2125) 	
at java.awt.Container.dispatchEventImpl(Container.java:1200) 	
at java.awt.Window.dispatchEventImpl(Window.java:914) 	
at java.awt.Component.dispatchEvent(Component.java:2497) 	
at java.awt.EventQueue.dispatchEvent(EventQueue.java:339) 	
at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.ja
va:131) 	
at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java
:98) 	
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)

at java.awt.EventDispatchThread.run(EventDispatchThread.java:85) 


Re: JPEGTranscoder or fill3DRect problem ?

Posted by Thierry Kormann <tk...@sophia.inria.fr>.
On Monday 02 July 2001 14:51, Sebastien Aurelie wrote:
> Hi !
>
> I paint a chart. For each bar I paint, I use fill3DRect. But it happens
> sometimes, that I need to paint a rectangle with a null height. I just have
> seen that fill3DRect draws this rectangle (even with a null height), and to
> have a 3D effect, it tries to paint a second rectangle with negative
> height! Well, no problem occurs for draw it. When a convert this
> negative-height-rectangle into svg, still no problem, but if I want to
> trancode it into a JPEG image, you can see the following exception.
> So, where is the source of the problem? Can we think that fill3DRect need
> to test the height of the rectangle before to draw it, or bridge of batik
> need to transcode negative height ?

According to the spec (Chapter 9.2 The 'rect' element):

"The height of the rectangle.
A negative value is an error (see Error processing). A value of zero disables 
rendering of the element."

I have checked the code of the bridge module (the one used by the transcoder) 
and a negative value generates an error (a value of zero is legal).

So, the bridge is right and the generator has a bug.
If you can add a bug report in bugzilla, that will help us.

Thanks for your feedback,
Thierry.




---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org