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 Nicolas <ni...@altiva.fr> on 2001/11/09 03:27:25 UTC

Sodipodi & Batik viewer: fill-opacity issue

Whenever I try to open an SVG file created with Sodipodi (a very nice
vector drawing program for Gnome, which natively implements SVG) in
Batik viewer, I get:

org.w3c.dom.DOMException: An element of type "svg" has an invalid inline
style: The "fill-opacity" property does not support percentage values.

Here's a sample of the code that generates this:

  <ellipse
     style="stroke:none; fill:#7f7f7f; fill-opacity:100%;
fill-rule:evenodd; stroke-opacity:100%; stroke-width:1px;
stroke-linejoin:miter; stroke-linecap:butt;"
     id="ellipse15"
     cx="243.365028"
     cy="324.312881"
     rx="112.516714"
     ry="80.747289" />

If I remove the fill-opacity parameter, Batik does'nt barf on it, but if
I just remove the "%" sign (ie by replacing "100%" by "1"), it doesn't
work. 

So what's the deal? What's the proper way to specify "fill-opacity"? 

BTW I'm using Batik 1.1rc3, sodipodi is from yesterday's CVS.


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


Re: Sodipodi & Batik viewer: fill-opacity issue

Posted by Vincent Hardy <vi...@sun.com>.
Nicolas,

Nicolas wrote:
> 
> le ven 09-11-2001 at 11:19 Vincent Hardy a écrit :
> 
> > The fill opacity should be a number between 0 and 1. Same for
> > stroke-opacity
> > further in your style declaration. Could you say what does not work if
> > you replace 100% with 1 in these two values? I just tried your example
> > and it works if you replace the two 100% values with the correct syntax.
> 
> Actually, correction, it works with a 0 to 1 number.
> 
> It's a known issue with sodipodi, gettting it fixed.
> 
> Is there a good reason why "%" values are not supported? I got a comment
> from someone else saying that there was no clear indication in the
> standard. Haven't had time to look for myself.

Section 11.3 "Fill Properties" of the SVG specification says describes 
the fill-opacity as follows:

"The opacity of the painting operation used to fill the current object. 
Any values outside the range 0.0 (fully transparent) to 1.0 (fully
opaque) 
will be clamped to this range.".

So I think that "%" are not supported because the spec. does not
allow them.

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

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


Re: Sodipodi & Batik viewer: fill-opacity issue

Posted by Nicolas <ni...@altiva.fr>.
le ven 09-11-2001 at 11:19 Vincent Hardy a écrit :

> The fill opacity should be a number between 0 and 1. Same for
> stroke-opacity
> further in your style declaration. Could you say what does not work if
> you replace 100% with 1 in these two values? I just tried your example 
> and it works if you replace the two 100% values with the correct syntax.

Actually, correction, it works with a 0 to 1 number. 

It's a known issue with sodipodi, gettting it fixed.

Is there a good reason why "%" values are not supported? I got a comment
from someone else saying that there was no clear indication in the
standard. Haven't had time to look for myself.


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


Re: Sodipodi & Batik viewer: fill-opacity issue

Posted by Vincent Hardy <vi...@sun.com>.
Nicolas,

Nicolas wrote:
> 
> Whenever I try to open an SVG file created with Sodipodi (a very nice
> vector drawing program for Gnome, which natively implements SVG) in
> Batik viewer, I get:
> 
> org.w3c.dom.DOMException: An element of type "svg" has an invalid inline
> style: The "fill-opacity" property does not support percentage values.
> 
> Here's a sample of the code that generates this:
> 
>   <ellipse
>      style="stroke:none; fill:#7f7f7f; fill-opacity:100%;
> fill-rule:evenodd; stroke-opacity:100%; stroke-width:1px;
> stroke-linejoin:miter; stroke-linecap:butt;"
>      id="ellipse15"
>      cx="243.365028"
>      cy="324.312881"
>      rx="112.516714"
>      ry="80.747289" />
> 
> If I remove the fill-opacity parameter, Batik does'nt barf on it, but if
> I just remove the "%" sign (ie by replacing "100%" by "1"), it doesn't
> work.

The fill opacity should be a number between 0 and 1. Same for
stroke-opacity
further in your style declaration. Could you say what does not work if
you replace 100% with 1 in these two values? I just tried your example 
and it works if you replace the two 100% values with the correct syntax.

V.

> 
> So what's the deal? What's the proper way to specify "fill-opacity"?
> 
> BTW I'm using Batik 1.1rc3, sodipodi is from yesterday's CVS.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: batik-users-help@xml.apache.org

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