-
Notifications
You must be signed in to change notification settings - Fork 581
Use resvg as library #2588
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
base: main
Are you sure you want to change the base?
Use resvg as library #2588
Conversation
Thanks for the PR! The changes are more extensive than I expected, is it possible to simplify it further:
Also, could you provide more specific impact data on build speed and binary size? In the past, some users have complained that Yazi's build speed is too slow (especially on Windows), and I'm very cautious about introducing new crates — I often end up implementing functionality myself to avoid adding them. |
ce3eb7f
to
a9c693e
Compare
Thanks for the feedback!
I'll also measure build time and binary size impact and post the results later. |
3bed2f7
to
10e07b0
Compare
This reverts commit 0082d11.
@sxyazi I've now implemented the changes as discussed:
|
1cc8e5a
to
a29dbb9
Compare
d1efbb8
to
a0ab614
Compare
35d9907
to
2768fd2
Compare
9f077f9
to
60a2382
Compare
This PR replaces the external resvg command with the embedded resvg Rust crate, addressing the out-of-memory issue more reliably than the previous setrlimit-based workaround.
Instead of applying OS-level memory limits, this PR calculates the bounding box of all SVG nodes in advance and scales the image down to fit within
max_width
andmax_height
, preventing excessive memory allocation during rendering:Build impact summary (Windows)
cargo build --profile release-windows --locked --timings
):TODO