Skip to content
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

Closed
wants to merge 1 commit into from

Conversation

luipir
Copy link
Contributor

@luipir luipir commented Jan 8, 2014

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

@tbonfort
Copy link
Member

tbonfort commented Jan 8, 2014

Does this actually work? I would have expected that msAddImageSymbol needs adjusting to set the symbol type to SVG.

@luipir
Copy link
Contributor Author

luipir commented Jan 8, 2014

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.

@tbonfort
Copy link
Member

tbonfort commented Jan 8, 2014

I haven't tested, this is just looking at the codepath ...
https://github.com/mapserver/mapserver/blob/master/mapsymbol.c#L400 : the symbol type is set to pixmap, which for me would imply that the subsequent drawing operations would fail

@luipir
Copy link
Contributor Author

luipir commented Jan 8, 2014

right... I'll try a solution. My tests was related onli to .map generation

@luipir
Copy link
Contributor Author

luipir commented Jan 8, 2014

I whould use MS_SYMBOL_SVG parsing file name to check filetype, type "image/svg-xml" remained up to the msAddImageSymbol call

@tbonfort
Copy link
Member

tbonfort commented Jan 8, 2014

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.

@aperi2007
Copy link

Please , I don't understand why this need of security
AFAIK these are all svg symbols available from filesystem.
So I dont understand why this should be a problem.

Is this not like as the fontset setting ?

@aperi2007
Copy link

you are think to a remote sld that ask to open as SVG another remote svg file ?

@luipir
Copy link
Contributor Author

luipir commented Jan 10, 2014

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!

@tbonfort
Copy link
Member

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.

STYLE
 SYMBOL '/tmp/xxyyyzzdfss.svg'
END

@luipir
Copy link
Contributor Author

luipir commented Jan 10, 2014

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 format

I'll check better

@luipir
Copy link
Contributor Author

luipir commented Jan 15, 2014

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.

@tbonfort
Copy link
Member

@luipir you haven't posted the changes you added to msAddImageSymbol

@luipir luipir closed this Jan 15, 2014
@luipir luipir reopened this Jan 15, 2014
@tbonfort
Copy link
Member

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 ?

@luipir
Copy link
Contributor Author

luipir commented Jan 15, 2014

@tbonfort I'm working on 6.4 updated code

@luipir
Copy link
Contributor Author

luipir commented Jan 16, 2014

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
@luipir
Copy link
Contributor Author

luipir commented Jan 16, 2014

reopened in a cleaner pull request: #4842

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants