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
added format "image/svg+xml" to msSLDParseExternalGraphic - added thanks to Faunalia and Regione Toscana - SITA #4836
Conversation
Does this actually work? I would have expected that msAddImageSymbol needs adjusting to set the symbol type to SVG. |
msAddImageSymbol no need modification... it use HTTP to donwload symbol or directly set the full pathname in case it is not a remote link but an absoluthe path. HTTP download is managed using msHTTPGetFile that is format type independent. |
I haven't tested, this is just looking at the codepath ... |
right... I'll try a solution. My tests was related onli to .map generation |
I whould use MS_SYMBOL_SVG parsing file name to check filetype, type "image/svg-xml" remained up to the msAddImageSymbol call |
Checking only for the extension seems reasonable. I'm not sure this should go in the 6.4 stable branch however, we should investigate the security implications of allowing librsvg to parse an arbitrary/potentially malicious SVG file. |
Please , I don't understand why this need of security Is this not like as the fontset setting ? |
you are think to a remote sld that ask to open as SVG another remote svg file ? |
parsed filename and set symbol->type = MS_SYMBOL_SVG (in mapsymbol.c) => svg is added in symbolSet but at the end no SYMBOL section is set in the map file! |
There would be no SYMBOL..END block set in the mapfile, just a reference to a temporary svg file (set in mapserver's TMPPATH, e.g.
|
my patch (this plus one in mapsymbol.c) produced the result you're talking about, but mapserver redering produced this error: msDrawMap(): Image handling error. Failed to draw layer named 'formapuntuale'. readImage(): General error message. unsupported pixmap formatI'll check better |
Hi Thomas, the solution could be adding: mapsymbol.c:403 - symbol->inmapfile = MS_TRUE; plus adding som rows parsing filename to know if it's SVG... the question is. What is the exact meaning of symbol->inmapfile boolean? I can't find a documentation about it. |
@luipir you haven't posted the changes you added to msAddImageSymbol |
I've tested your msAddSymbol() changes outside of SLD and they work correctly. Are you sure you were using an updated version when you were testing ? |
@tbonfort I'm working on 6.4 updated code |
Ok... I've to cleanup my pull-request sorry |
…oscana - SITA added support to svg managing creation of SYMBOL for each svg symbol and setting MS_SYMBOL_SVG removed unused inlude added support to svg managins creation of SYMBOL for each svg symbol and setting MS_SYMBOL_SVG removed unused inlude
reopened in a cleaner pull request: #4842 |
added format "image/svg+xml" to msSLDParseExternalGraphic - added thanks to Faunalia and Regione Toscana - SITA
in this way it's possibile to add external svg URL in a SLD.
patch is useful only if mapserver is compiled with CURL