-
Notifications
You must be signed in to change notification settings - Fork 475
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SvgColourMatrixFix fix #540
SvgColourMatrixFix fix #540
Conversation
- prevents crash, fixes svg-net#518 - added test
@@ -87,7 +87,7 @@ public override void Process(ImageBuffer buffer) | |||
}; | |||
break; | |||
default: // Matrix | |||
var parts = this.Values.Replace(" ", " ").Split(new char[] { ' ', '\t', '\n', '\r', ',' }); | |||
var parts = this.Values.Split(new char[] { ' ', '\t', '\n', '\r', ',' }, StringSplitOptions.RemoveEmptyEntries); | |||
colorMatrixElements = new float[5][]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks - good catch! Could you add your test svg together with the corresponding png as a regression test?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can do this but later if that's ok?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mrbean-bremen Seems like the png is not rendered correctly using SVG lib. The issue was only related to the string parsing not rendering.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can see one issue, the Filter
property is inherited by Children of the use
element, which is not what spec says. The Fileter
property is not inheritable: https://www.w3.org/TR/SVG11/filters.html#FilterProperty, the same issue I had was with Opacity
: https://www.w3.org/TR/SVG11/masking.html#ObjectAndGroupOpacityProperties
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for digging into this! I will merge as is in this case. Filters are generally very poorly supported (see #43), so I'm not too surprised by this, though the inheritance problem is something that certainly shall be fixed.
What does this implement/fix? Explain your changes.
Fixes string Split for matrix type.
Repro: