-
Notifications
You must be signed in to change notification settings - Fork 59
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
Referenced element deleted #303
Comments
I think you might have a malformed file, since you have a defs in defs<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<defs>
<defs>
<path id="a" d="M423.69 131.81h350.88v413.67H423.69z"/>
</defs>
<clipPath id="b">
<use width="841.89" height="595.28" xlink:href="#a"/>
</clipPath>
</defs>
<path fill="#fd0" stroke="#000" stroke-width=".458" d="M700.52 304.98c13.331-13.353 28.933-28.998 36.853-37.016 2.537-2.568.719 99.61.719 144.98 0 21.273-13.272 96.323-91.104 58.556 0 0-38.89-13.962-50.247-30.79 2.646 0 5.267-.169 7.851-.495 1.183.634 2.446 1.226 3.775 1.775 44.896 30.248 71.666 7.998 71.666 7.998 24.757-15.589 28.807-63.192 28.425-69.688" clip-path="url(#b)" transform="matrix(1.1464 0 0 1.1712 -486.82 -157.86)"/>
</svg> good file<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<defs>
<path id="a" d="M423.69 131.81h350.88v413.67H423.69z"/>
<clipPath id="b">
<use width="841.89" height="595.28" xlink:href="#a"/>
</clipPath>
</defs>
<path fill="#fd0" stroke="#000" stroke-width=".458" d="M700.52 304.98c13.331-13.353 28.933-28.998 36.853-37.016 2.537-2.568.719 99.61.719 144.98 0 21.273-13.272 96.323-91.104 58.556 0 0-38.89-13.962-50.247-30.79 2.646 0 5.267-.169 7.851-.495 1.183.634 2.446 1.226 3.775 1.775 44.896 30.248 71.666 7.998 71.666 7.998 24.757-15.589 28.807-63.192 28.425-69.688" clip-path="url(#b)" transform="matrix(1.1464 0 0 1.1712 -486.82 -157.86)"/>
</svg> |
This was excerpt from a real-world example: https://en.wikipedia.org/wiki/Coat_of_arms_of_Ecuador |
FYI: I repaired https://commons.wikimedia.org/wiki/File:Coat_of_arms_of_Ecuador.svg |
I ran into this issue as well. According to the SVG standard, Removing the hierarchy as a workaround does work. |
scour breaks SVG by deleting referenced element.
Original file:
Compressed file:
Note that "defs241" is removed despite "SVGID_9_" being referenced. This leads to broken image.
Workaround is to set "--keep-unreferenced-defs".
The text was updated successfully, but these errors were encountered: