| Crates.io | usvg-remote-resolvers |
| lib.rs | usvg-remote-resolvers |
| version | 0.1.3 |
| created_at | 2024-12-26 15:34:42.151845+00 |
| updated_at | 2025-08-24 07:53:21.301821+00 |
| description | A library for resolving remote resources in SVG files for usvg. |
| homepage | |
| repository | https://github.com/aobatact/usvg-remote-resolvers |
| max_upload_size | |
| id | 1495713 |
| size | 68,069 |
usvg-remote-resolvers is a Rust library that provides remote resource resolvers for the usvg library. It allows you to fetch and resolve external resources such as images and fonts referenced in SVG files.
usvgAdd the following to your Cargo.toml:
[dependencies]
usvg-remote-resolvers = "0.1"
use usvg_remote_resolvers::BlockingReqwestResolver;
let resolver = BlockingReqwestResolver::default();
let mut options = usvg::Options::default();
options.image_href_resolver.resolve_string = resolver.into_fn();
let tree = usvg::Tree::from_str(
r#"<svg xmlns="http://www.w3.org/2000/svg">
<image href="https://example.com/sample.png" />
</svg>"#,
&options,
)
.unwrap();
This project is licensed under the MIT License. See the LICENSE file for details.
Contributions are welcome! Please open an issue or submit a pull request.
For any questions or suggestions, please open an issue on GitHub.