[feat (issue #6389)] make tauri icon support SVGs#6444
[feat (issue #6389)] make tauri icon support SVGs#6444lucasfernog merged 13 commits intotauri-apps:devfrom
Conversation
|
This is an awesome addition! @amrbashir maybe this is something we could use downstream in CTA later as well to reduce the size even more? Edit: Would require a few more changes to the actual core bits of Tauri that pull in the rendered icons I realise, but still cool to move closer to that possibility! |
|
Cool! If this ends up getting merged, and tauri changes its logic to depend on a single svg icon and generate the others on the fly, it will save us a couple of hunderd kilobytes |
|
As per discussion in the Discord, there are a couple points worth checking before merge.
In response to the previous comments… are you guys talking about saving extra disk space? So, if an SVG is used, the PNGs arent saved to disk? Just some clarification here would help thanks! |
|
@fetzsav we were just having a slight sidebar for CTA (create-tauri-app) for a few ideas of how this could help get us closer to shrinking the templates down there in the future. You'd still need to generate the raster images to use in icons, this PR just helps us get closer to using SVGs to generate those raster images and then in theory in the future we could use that functionality to optimise CTA. tl;dr no impact to this, just some enhancements we could get closer to downstream with this PR |
|
I think this feature should target the v2 release, v1.3 is pretty much ready and the idea is to focus 100% on v2 when that release is out. |
|
I tried to use resvg but couldn't get the resize to work. Can you review @FabianLars ? |
|
I switched back to resvg because nsvg failed to resize my very first test icon 😂 (it worked with other test files, resvg could handle all i tested). Resizing should work, but i know what issue you were talking about. Also the ios bg color is now applied after resizing to make sure it's the svg renderer resizing it and not image-rs. Seemed to work on my end but i have no ios setup to test this rn. |
| size: u32, | ||
| file_path: &Path, | ||
| ios_color: Option<Rgba<u8>>, | ||
| bg_color: Option<Rgba<u8>>, |
There was a problem hiding this comment.
i swear i named it this way first but reverted it for no reason 😂
What kind of change does this PR introduce?
Does this PR introduce a breaking change?
Checklist
fix: remove a typo, closes #___, #___)Other information
This allows .SVG files to be passed into the CLI's icon module. This was a request in the issues tab