mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-16 16:42:52 +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.
50 lines
1.8 KiB
TOML
50 lines
1.8 KiB
TOML
[package]
|
|
name = "vectorcraft-svg"
|
|
version.workspace = true
|
|
edition.workspace = true
|
|
license.workspace = true
|
|
description = "VectorCraft SVG import and export"
|
|
|
|
[lints]
|
|
workspace = true
|
|
|
|
[dependencies]
|
|
craft-svg = { workspace = true }
|
|
# Which paths stored in documents may be opened.
|
|
craft-docpath = { workspace = true }
|
|
vectorcraft-geom = { workspace = true }
|
|
vectorcraft-color = { workspace = true }
|
|
vectorcraft-doc = { workspace = true }
|
|
vectorcraft-effects = { workspace = true }
|
|
vectorcraft-brush = { workspace = true }
|
|
vectorcraft-text = { workspace = true }
|
|
vectorcraft-pathops = { workspace = true }
|
|
kurbo = { workspace = true }
|
|
usvg = { workspace = true }
|
|
thiserror = { workspace = true }
|
|
serde = { workspace = true }
|
|
# Live effect params read from filters.
|
|
serde_json = { workspace = true }
|
|
# SVGZ (gzip, pure-Rust backend: builds for wasm).
|
|
flate2 = { workspace = true }
|
|
image = { workspace = true }
|
|
# Image data URLs decoded as usvg decodes them, within a byte limit (MIT OR Apache-2.0; already used by usvg).
|
|
data-url = "0.3.2"
|
|
# Colour / transform / length parsing for the <text> fallback (MIT OR Apache-2.0; already used by usvg).
|
|
svgtypes = "0.16"
|
|
simplecss = "0.2.2"
|
|
# Bidi classes for the first strong character of `unicode-bidi: plaintext` text (MIT OR Apache-2.0; already used by vectorcraft-text).
|
|
unicode-bidi = "0.3.18"
|
|
|
|
[dev-dependencies]
|
|
# Reading embedded font subsets back.
|
|
skrifa = { workspace = true }
|
|
# A variable font built in code (no font file is committed).
|
|
vectorcraft-text = { workspace = true, features = ["test-fonts"] }
|
|
resvg = { version = "0.45", default-features = false, features = ["raster-images"] }
|
|
# usvg as a reference viewer that lays text out in a font (text_layout.rs).
|
|
usvg = { workspace = true, features = ["text"] }
|
|
vectorcraft-testkit = { workspace = true }
|
|
proptest = { workspace = true }
|
|
image = { workspace = true }
|