Bug 36743 - feColorMatrix - bad implementation of the values attribute
Summary: feColorMatrix - bad implementation of the values attribute
Status: RESOLVED INVALID
Alias: None
Product: Batik - Now in Jira
Classification: Unclassified
Component: SVGGraphics2D (show other bugs)
Version: 1.6
Hardware: All Linux
: P2 normal
Target Milestone: ---
Assignee: Batik Developer's Mailing list
URL: http://hejral.mysteria.cz/svg-bug/bat...
Keywords:
Depends on:
Blocks:
 
Reported: 2005-09-20 21:52 UTC by Martin Hejral
Modified: 2005-09-21 10:23 UTC (History)
0 users



Attachments
test case (3.15 KB, image/svg+xml)
2005-09-20 21:53 UTC, Martin Hejral
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Hejral 2005-09-20 21:52:44 UTC
- feColorMatrix - there is bad implementation of the values attribute - I think,
problem is caused by the incorrect parsing operation: white spaces should be
IGNORED, but aren't! - also it seems another problem are real numbers written as
".5" ".79" etc.
Comment 1 Martin Hejral 2005-09-20 21:53:50 UTC
Created attachment 16468 [details]
test case
Comment 2 Martin Hejral 2005-09-20 21:55:15 UTC
Comment on attachment 16468 [details]
test case

- Batik log:

Loading document...
Loading document completed in 135 ms
Building document...
org.apache.batik.bridge.BridgeException: feColorMatrix.svg:42
The attribute "values" of the element "feColorMatrix" is invalid
	at
org.apache.batik.bridge.SVGFeColorMatrixElementBridge.convertValuesToSaturate(U
nknown Source)
	at
org.apache.batik.bridge.SVGFeColorMatrixElementBridge.createFilter(Unknown
Source)
	at
org.apache.batik.bridge.SVGFilterElementBridge.buildLocalFilterPrimitives(Unkno
wn Source)
	at
org.apache.batik.bridge.SVGFilterElementBridge.buildFilterPrimitives(Unknown
Source)
	at org.apache.batik.bridge.SVGFilterElementBridge.createFilter(Unknown
Source)
	at org.apache.batik.bridge.CSSUtilities.convertFilter(Unknown Source)
	at
org.apache.batik.bridge.SVGTextElementBridge.buildGraphicsNode(Unknown Source)
	at org.apache.batik.bridge.GVTBuilder.buildGraphicsNode(Unknown Source)
	at org.apache.batik.bridge.GVTBuilder.buildComposite(Unknown Source)
	at org.apache.batik.bridge.GVTBuilder.buildGraphicsNode(Unknown Source)
	at org.apache.batik.bridge.GVTBuilder.buildComposite(Unknown Source)
	at org.apache.batik.bridge.GVTBuilder.build(Unknown Source)
	at org.apache.batik.swing.svg.GVTTreeBuilder.run(Unknown Source)
Building document failed.
Comment 3 Thomas Deweese 2005-09-21 03:17:47 UTC
The problem line from your sample was line 42:
      <feColorMatrix type="saturate" in="SourceGraphic" values="30%"/>

Reading the SVG 1.1 spec 15.10 on 'values':
   For type="saturate", values is a single real number value (0 to 1).

   The values attribute does not support percentages.  Once I changed
this to be '.3' the content loaded and appears to render fine.
Comment 4 Martin Hejral 2005-09-21 11:17:40 UTC
(In reply to comment #3)
> The problem line from your sample was line 42:
>       <feColorMatrix type="saturate" in="SourceGraphic" values="30%"/>
> 
> Reading the SVG 1.1 spec 15.10 on 'values':
>    For type="saturate", values is a single real number value (0 to 1).
> 
>    The values attribute does not support percentages.  Once I changed
> this to be '.3' the content loaded and appears to render fine.

OK, I understand. Thanks.

-----------

http://www.w3.org/TR/SVG11/filters.html#feColorMatrix

Text from spec.:

For type="saturate", values is a single real number value (0 to 1). A saturate
operation is equivalent to the following matrix operation:

This code is cut off from SVG 1.1 spec. example:

    <filter id="Saturate40" filterUnits="objectBoundingBox" 
            x="0%" y="0%" width="100%" height="100%">
      <feColorMatrix type="saturate" in="SourceGraphic" values="40%"/>
    </filter>

----------

It's caused probably by great tolerance of the Adobe Viewer and a manner in
practical graphics design domain... (I personally working as designer now.)

My question is: Is the problem allow for this case percentage values? (Values
are always in range 0..1)
Comment 5 Thomas Deweese 2005-09-21 14:05:24 UTC
What version of the SVG 1.1 spec are you looking at?
My version (and the official online version) does not use '%':
   http://www.w3.org/TR/SVG11/filters.html#feColorMatrix

To answer your question on if percentage can be used I don't
think so since the values attribute is defined to be a list
of '<number>' which does not allow units or percentages.
Comment 6 Martin Hejral 2005-09-21 18:23:38 UTC
(In reply to comment #5)
> What version of the SVG 1.1 spec are you looking at?

exactly this file:
http://www.w3.org/TR/SVG11/images/filters/feColorMatrix.svg