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

Svg Base64 Icon Image Format in SLD files is not read #693

Open
pragmaeuge opened this issue Oct 13, 2022 · 1 comment
Open

Svg Base64 Icon Image Format in SLD files is not read #693

pragmaeuge opened this issue Oct 13, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@pragmaeuge
Copy link

pragmaeuge commented Oct 13, 2022

Bug

Describe the bug
Svg Base64 Icon Image Format in SLD files is not parsed (version 4.0.1)

To Reproduce

QGIS generates the following SLD v1.1.0 code piece:

<se:PointSymbolizer>
            <se:Graphic>
              <!--Parametric SVG-->
              <se:ExternalGraphic>
                <se:OnlineResource xlink:type="simple" xlink:href="base64:PHN2ZyBoZWlnaHQ9IjEwOS41cHQiIHZpZXdCb3g9IjAgMCAxMDkuNSAxMDkuNSIgd2lkdGg9IjEwOS41cHQiPjxnIGZpbGw9IiMwMDA0MDAiIHN0cm9rZT0iIzAwMCI+PHBhdGggZD0ibTc0LjA2MyA1NC43NWMwLTEwLjg3My04LjgxNC0xOS42ODgtMTkuNjg4LTE5LjY4OHMtMTkuNjg3IDguODE1LTE5LjY4NyAxOS42ODggOC44MTQgMTkuNjg4IDE5LjY4OCAxOS42ODggMTkuNjg4LTguODE0IDE5LjY4OC0xOS42ODh6IiBmaWxsPSIjMDA3ZjBhIiBzdHJva2U9IiMwMDdhMGEiLz48cGF0aCBkPSJtMTA5IDU5LjVoLTEwOC41di05aDEwOC41eiIvPjxwYXRoIGQ9Im01OSAxMDloLTkuMjV2LTEwOC41aDkuMjV6Ii8+PC9nPjwvc3ZnPg==?fill=%23232323&amp;fill-opacity=1&amp;outline=%23232323&amp;outline-opacity=1&amp;outline-width=1"/>
                <se:Format>image/svg+xml</se:Format>
              </se:ExternalGraphic>
              <!--Plain SVG fallback, no parameters-->
              <se:ExternalGraphic>
                <se:OnlineResource xlink:type="simple" xlink:href="base64:PHN2ZyBoZWlnaHQ9IjEwOS41cHQiIHZpZXdCb3g9IjAgMCAxMDkuNSAxMDkuNSIgd2lkdGg9IjEwOS41cHQiPjxnIGZpbGw9IiMwMDA0MDAiIHN0cm9rZT0iIzAwMCI+PHBhdGggZD0ibTc0LjA2MyA1NC43NWMwLTEwLjg3My04LjgxNC0xOS42ODgtMTkuNjg4LTE5LjY4OHMtMTkuNjg3IDguODE1LTE5LjY4NyAxOS42ODggOC44MTQgMTkuNjg4IDE5LjY4OCAxOS42ODggMTkuNjg4LTguODE0IDE5LjY4OC0xOS42ODh6IiBmaWxsPSIjMDA3ZjBhIiBzdHJva2U9IiMwMDdhMGEiLz48cGF0aCBkPSJtMTA5IDU5LjVoLTEwOC41di05aDEwOC41eiIvPjxwYXRoIGQ9Im01OSAxMDloLTkuMjV2LTEwOC41aDkuMjV6Ii8+PC9nPjwvc3ZnPg=="/>
                <se:Format>image/svg+xml</se:Format>
              </se:ExternalGraphic>
              <!--Well known marker fallback-->
              <se:Mark>
                <se:WellKnownName>square</se:WellKnownName>
                <se:Fill>
                  <se:SvgParameter name="fill">#232323</se:SvgParameter>
                </se:Fill>
                <se:Stroke>
                  <se:SvgParameter name="stroke">#232323</se:SvgParameter>
                  <se:SvgParameter name="stroke-width">1</se:SvgParameter>
                </se:Stroke>
              </se:Mark>
              <se:Size>32</se:Size>
            </se:Graphic>
          </se:PointSymbolizer>

When I inspect the SLD parser output I obtain this symbolizers object:

[
    {
        "kind": "Icon",
        "image": "base64:PHN2ZyBoZWlnaHQ9IjEwOS41cHQiIHZpZXdCb3g9IjAgMCAxMDkuNSAxMDkuNSIgd2lkdGg9IjEwOS41cHQiPjxnIGZpbGw9IiMwMDA0MDAiIHN0cm9rZT0iIzAwMCI+PHBhdGggZD0ibTc0LjA2MyA1NC43NWMwLTEwLjg3My04LjgxNC0xOS42ODgtMTkuNjg4LTE5LjY4OHMtMTkuNjg3IDguODE1LTE5LjY4NyAxOS42ODggOC44MTQgMTkuNjg4IDE5LjY4OCAxOS42ODggMTkuNjg4LTguODE0IDE5LjY4OC0xOS42ODh6IiBmaWxsPSIjMDA3ZjBhIiBzdHJva2U9IiMwMDdhMGEiLz48cGF0aCBkPSJtMTA5IDU5LjVoLTEwOC41di05aDEwOC41eiIvPjxwYXRoIGQ9Im01OSAxMDloLTkuMjV2LTEwOC41aDkuMjV6Ii8+PC9nPjwvc3ZnPg==?fill=%23232323&fill-opacity=1&outline=%23232323&outline-opacity=1&outline-width=1",
        "size": 32
    }
]

Where the "format" property is missing.

Expected behavior

[
    {
        "kind": "Icon",
        "image": "base64:PHN2ZyBoZWlnaHQ9IjEwOS41cHQiIHZpZXdCb3g9IjAgMCAxMDkuNSAxMDkuNSIgd2lkdGg9IjEwOS41cHQiPjxnIGZpbGw9IiMwMDA0MDAiIHN0cm9rZT0iIzAwMCI+PHBhdGggZD0ibTc0LjA2MyA1NC43NWMwLTEwLjg3My04LjgxNC0xOS42ODgtMTkuNjg4LTE5LjY4OHMtMTkuNjg3IDguODE1LTE5LjY4NyAxOS42ODggOC44MTQgMTkuNjg4IDE5LjY4OCAxOS42ODggMTkuNjg4LTguODE0IDE5LjY4OC0xOS42ODh6IiBmaWxsPSIjMDA3ZjBhIiBzdHJva2U9IiMwMDdhMGEiLz48cGF0aCBkPSJtMTA5IDU5LjVoLTEwOC41di05aDEwOC41eiIvPjxwYXRoIGQ9Im01OSAxMDloLTkuMjV2LTEwOC41aDkuMjV6Ii8+PC9nPjwvc3ZnPg==?fill=%23232323&fill-opacity=1&outline=%23232323&outline-opacity=1&outline-width=1",
        "size": 32,
        "format":"image/svg+xml"
    }
]
@pragmaeuge pragmaeuge added the bug Something isn't working label Oct 13, 2022
@jansule
Copy link
Contributor

jansule commented Oct 17, 2022

Thanks for the info @pragmaeuge. The current version of the geostyler-sld-parser does not support the format property yet. Are you planning on providing a PR for that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Todo
Development

No branches or pull requests

3 participants