-
Notifications
You must be signed in to change notification settings - Fork 228
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
Separate options for rendered SVG size and total image canvas size #825
Comments
The problem with this feature is that everyone want a slightly different behavior and it would be somewhat hard to handle all cases. Will see. |
Thinking about this a bit more, I think the following CLI options would satisfy everyone's needs:
What do you think? I don't know how hard it is to implement Btw resvg is already pretty awesome as is so thanks for this great piece of software. I would love to help out with PRs but I'm no Rust programmer... yet. |
Hard to say without trying. Maybe someone would be interested in sending a PR. |
Currently we are able to provide render size via
--width
and--height
options but there is no way to produce a padded png from a non-padded svg.My use case revolves around generating a bunch of website favicons from an svg file.
At first I tried to create another padded svg file which references the original file with
<use xlink:href="favicon.svg#id" />
to avoid duplication but turns out external file references are not supported yet.Then I tried to see if it's possible to somehow specify render and final image sizes separately but looks like it's also not possible currently.
Feature Request
Introduce
--render-width
and--render-height
to specify what size the svg will be rendered. If the render size is smaller then image size, it is centered. If the render size is bigger, it is centered but also cropped.We can think about introducing a
--scale-mode=(scale,fill,stretch,none)
option later on if necessary.The text was updated successfully, but these errors were encountered: