Skip to content

Auto width/height for manganis images #5458

@ealmloff

Description

@ealmloff

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));

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestmanganisRelated to the manganis crate

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions