DioxusLabs / manganis

An asset system for the Rust ecosystem
44 stars 12 forks source link

SVG Support With image() #21

Open DogeDark opened 7 months ago

DogeDark commented 7 months ago

Specific Demand

The capability to use SVG images with the image() function in manganis:

const DIOXUS_LOGO: manganis::ImageAsset = manganis::mg!(image("./assets/dioxus_color.svg"));
// instead of
const DIOXUS_LOGO: &str = manganis::mg!(file("./assets/dioxus_color.svg"));

While it works with file(), one could assume to use image() and end up confused like me.

rambip commented 6 months ago

What if the library gave an error like "the mg!(image(...)) macro can only be used for matrix images. Svg is a vector image, so use mg!(file()) instead" ?

ealmloff commented 6 months ago

There are cases where treating svgs as images is nice. Images contain options for low quality image previews which would be nice to support for svgs as well with something like this