DioxusLabs/dioxus

Auto width/height for manganis images

Offen

#5.458 geöffnet am 07.04.2026

 (0 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)Rust (1.655 Forks)batch import
enhancementgood first issuemanganis

Repository-Metriken

Stars
 (36.038 Sterne)
PR-Merge-Metriken
 (Durchschn. Merge 16T 13h) (9 gemergte PRs in 30 T)

Beschreibung

Feature Request

You can currently not set the image size for images or set both the width and height. You should be able to set either the width or height and have the other derived from the aspect ratio of the image

Implement Suggestion

Allow with_width or with_height and derive the other dimension

// Resize the image at compile time to make the assets smaller
pub const RESIZED_PNG_ASSET: Asset =
    asset!("/assets/image.png", AssetOptions::image().with_width(52));

or

// Resize the image at compile time to make the assets smaller
pub const RESIZED_PNG_ASSET: Asset =
    asset!("/assets/image.png", AssetOptions::image().with_height(52));

Contributor Guide