svg/svgo

duplicate embedded images

nschloe opened this issue · 1 comments

I frequently deal with SVGs with embedded raster images. They sometimes embed images more than once, even many times, e.g.

...
<image ns1:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAH8AAAAbAQAAAAB9o23yAAAADUlEQVR42mMYBcMFAAABywABVwMJ1QAAAABJRU5ErkJggg==" id="V" width="127" height="27" x="0" y="0"/>
<image ns1:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAH8AAAAdAQAAAACr+o7vAAAADUlEQVR42mMYBSMHAAAB7QABf4wHzwAAAABJRU5ErkJggg==" id="X" width="127" height="29" x="0" y="0"/>
...

In my case they all appear in the <defs> section, so deduplicating that would probably help.

The data between those could be shared.

Duplicate of #802.