-
Notifications
You must be signed in to change notification settings - Fork 214
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
Add optional parameters to limit the maximum dimensions ---max-width, --max-height #647
Comments
What behavior do you expect? I would assume that images larger than required should simply be rejected, while your patch simply downscales them. |
I need to preview all svg images with a maximum dimension of 200x200. |
Isn't this exactly what the current |
And if i use --width and --height as maybe the problem is elsewhere and the method tiny_skia::size::scale_to doesn't do exactly what it suggests... |
Oh, so you do not what to upscale the SVG, only downscale it. I get it now. PS: you can easily achieve what you want from code, obviously. But it would take some time to add to the CLI. |
Thank you for being so responsive. Indeed, the name of my parameter can be confusing. You are better placed than me to choose a name :) . |
Interesting, so those CSS properties do work as you want? I'm not a web developer, so I'm not very familiar with CSS. |
Yes these CSS properties do exactly that. |
…mensions ---max-width, --max-height
Some svgs have a huge viewbox and I would need to limit the size of the png produced.
The current settings (-w and -h) allow this if the image is larger than the given values.
If the image is smaller then it will be enlarged.
The idea is therefore not to exceed a given dimension (optional).
I made the changes and created a git patch.
Be indulgent, it's the first time I do Rust ;-)
So you can do much better, but if it can make your job easier, I'd be happy ;-)
add_max_width_height.patch
The text was updated successfully, but these errors were encountered: