Skip Menu |

This queue is for tickets about the SVG-Rasterize CPAN distribution.

Report information
The Basics
Id: 62943
Status: resolved
Priority: 0/
Queue: SVG-Rasterize

People
Owner: Nobody in particular
Requestors: RENEEB [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.003004
Fixed in: 0.003005



Subject: Comments in SVG blow up rendering
I have a simple SVG created with Graph::Easy (see attachment) that I want to rasterize. But I get the error "Element 'comment' is not a valid child of element 'svg'" Comments should be ignored.
Subject: easy.svg
Download easy.svg
image/svg+xml 3.6k
easy.svg
Hello Renee, this bug is fixed in version 0.003005 which I just uploaded. However, your file will still not work since it has at least the following issues: 1) easy.svg contains id attributes which consist of a single digit. This is not valid XML since XML id attributes are not allowed to start with a number. See http://www.w3.org/TR/2006/REC-xml11-20060816/#sec-attribute-types 2) easy.svg contains transform attributes like this: transform="translate(72.5 164.2)rotate(90)" This is not valid SVG. Some details of the SVG specification are ambiguous, but for the transform attribute it gives a Backus-Naur form which specifies that between the different transformations there has to be a comma and/or at least one white space character. You might want to report these issues as bugs in Graph::Easy. Otherwise I can do it. I am not sure how to handle things like this in SVG::Rasterize. On one hand I, of course, want the module to be useful and don't want to impede users' work by being overstrict. On the other hand it is my general opinion that if there is a clear standard it should be followed. I will try to think of a feasible way to allow the user to relax certain constraints. Thanks for your bug report Lutz
There are two things I forgot: 1) I wanted to give a reference for the BNF of the transform attribute. You can find it here: http://www.w3.org/TR/SVG11/coords.html#TransformAttribute 2) I wanted to mention that your example file might not render too nicely even if the problems I mentioned are fixed. It uses a CSS style section for formatting. This is not supported by SVG::Rasterize at the moment. I will have to look into existing CSS parsing modules on CPAN since I don't want to implement this functionality myself. Best wishes Lutz
Hi Lutz, thanks for fixing the original bug. I will play with Graph::Easy a bit more and report the bugs myself... Thanks for the hints anyway! I would propose that your module works with the standard and -- if it's not too much work -- a lax version. - Renée
Hi Renee, Show quoted text
> I would propose that your module works with the standard and -- if it's > not too much work -- a lax version.
Yes, that's also what I think is the most desirable way to go. I will think about how I can offer a way to relax the strictness. Best wishes Lutz