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

Logo get rendered incorrect #1148

Open
anthonn opened this issue Mar 20, 2024 · 6 comments
Open

Logo get rendered incorrect #1148

anthonn opened this issue Mar 20, 2024 · 6 comments

Comments

@anthonn
Copy link

anthonn commented Mar 20, 2024

Description

This SVG:
source

Gets rendered as:
render

The followin test code was used:

var svg = SvgDocument.Open<SvgDocument>(Stream);
_image = svg.Draw();
_image.Save("render.png");

Stream.Seek(0, SeekOrigin.Begin);
using var save = File.Open("source.svg", FileMode.Create);
Stream.CopyTo(save);				

Example data

images.zip

Used Versions

.NET 4.8
SVG 3.4.7

@H1Gdev
Copy link
Contributor

H1Gdev commented Apr 15, 2024

@anthonn

(workaround)

First of all, this will be correctly rendered.

    <g transform="translate(0 .047)" fill="none" fill-rule="evenodd">
       <!-- (workaround)moved this element. -->
        <mask id="f" fill="#fff"><use xlink:href="#e" /></mask>

        <g transform="translate(142.142)">
            <mask id="b" fill="#fff"><use xlink:href="#a" /></mask>
            <path d="M7.281 16.708c.795-5.661 5.517-10.245 11.45-10.245 5.985 0 10.713 4.547 11.504 10.245h7.019C36.38 7.258 28.467.26 18.835.26 9.118.261 1.16 7.195.264 16.708H7.28z" fill="#FF8300" mask="url(#b)" />
        </g>

        <path d="M172.372 20.141c-.804 5.69-5.484 10.297-11.5 10.297-5.963 0-10.636-4.643-11.445-10.297h-7.034c.819 9.577 8.76 16.446 18.48 16.446 9.651 0 17.67-6.933 18.526-16.446h-7.027zM0 12.8h6.775V6.933h12.456V1.043H0z" fill="#FF8300" />

        <g transform="translate(0 16.033)">
            <mask id="d" fill="#fff"><use xlink:href="#c" /></mask>
            <path fill="#FF8300" mask="url(#d)" d="M6.775 6.09h11.987V.201H0v19.571H19.23v-5.89H6.775z" />
        </g>

        <path fill="#FF8300" d="M26.67 29.916v5.89h17.46v-5.89H33.444z" />

        <path fill="#FF8300" mask="url(#f)" d="M26.67 26.483h6.775V1.043H26.67zM48.484 26.483h6.775V1.043h-6.775zM77.099 22.124h11.987v-5.89H70.324v19.572h19.231v-5.89H77.1zM106.223 16.21h-7.13l8.505 20.482h3.596l1.628-3.868-3.686-9.284zM48.484 29.916v5.89h17.46v-5.89H55.258zM129.545 16.708h6.776V1.043h-6.776zM129.545 36.692h6.776v-16.55h-6.776zM118.855 1.043l-7.523 18.725 3.392 8.54 11.48-27.265zM100.197 1.043h-7.4l4.871 11.733h7.191zM70.324 12.8h6.775V6.933h12.456V1.043H70.324z" />
    </g>

@anthonn
Copy link
Author

anthonn commented May 23, 2024

Another logo that get corrupted at rendering:
image

Should look like:
download

svg.zip

@H1Gdev
Copy link
Contributor

H1Gdev commented Jun 5, 2024

@anthonn

mask attribute of <path> element is not implemented...

@mrbean-bremen
Copy link
Member

See #482. There is actually an old PR #825 that seems to fix this, I don't know the state of that.
@H1Gdev - you had reviewed it at the time, can you please have a look?

@H1Gdev
Copy link
Contributor

H1Gdev commented Jun 5, 2024

@mrbean-bremen

PR #825 has conflicts with the latest source code.
Also, looking at the background, it seems that this PR #825 has not been completed.

@mrbean-bremen
Copy link
Member

Ok, thanks - conflicts can be resolved, but if it was not finished...

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

No branches or pull requests

3 participants