[prev in list] [next in list] [prev in thread] [next in thread] 

List:       batik-dev
Subject:    [jira] [Created] (BATIK-1220) missing of width/height rect attribute breaks transcoding
From:       "Anton Tarasov (JIRA)" <jira () apache ! org>
Date:       2018-03-20 18:17:00
Message-ID: JIRA.13146623.1521569806000.63818.1521569820218 () Atlassian ! JIRA
[Download RAW message or body]

Anton Tarasov created BATIK-1220:
------------------------------------

             Summary: missing of width/height rect attribute breaks transcoding
                 Key: BATIK-1220
                 URL: https://issues.apache.org/jira/browse/BATIK-1220
             Project: Batik
          Issue Type: Bug
          Components: Bridge
    Affects Versions: 1.9
            Reporter: Anton Tarasov
         Attachments: Main.java, image.svg

Consider the following svg:

  
{code:java}
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20">
<!--<rect x="5" y="5" width="10" height="10"/>-->
<rect x="5" y="5"/>
<text x="5" y="12" fill="red" font-size="6">rect</text>
</svg>  
{code}
  

When transcoding this SVG, it's ok when the "rect" element contains with/height \
attributes, but  when  they're  missing an exception is  thrown from \
SVGRectElementBridge:

  
{code:java}
org.apache.batik.bridge.BridgeException
The attribute "width" of the element <rect> is required{code}

This breaks  transcoding  completely. However,  standard browsers (Chrome/Edge etc.) \
just ignore the missing and display the rest of the svg content. I  can't see any  \
way to tell  Batik to behave the same way...

The only workaround I  found is to override \
SVGOMAnimatedLength.createLiveAnimatedLength so that it replaces null  default value \
with "0" for "width/height" in SVGOMRectElement.  The code is attached.

Please, advice any better solution if possible. Thank you.

  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic