mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-15 07:10:13 +00:00
usvg decodes an image data URL every time it converts the element that holds it, a `<use>` copy, a filter or a nested SVG image included, before the image resolver is called, and nothing bounded the bytes decoded per import. Before usvg reads the imported SVG and each SVG shown as an image, every `href` and `xlink:href` of an `<image>` or `<feImage>` that is a data URL is replaced with a key. The resolver decodes each URL once, the first time its key comes, and every later use gets the same image. All data URLs of one import decode to at most 512 MB together (MAX_DATA_URL_BYTES): decoding stops where a URL would pass it, and that image is left out with a warning. A link spelled like a key gets a key too and is still read as that link.