Skip to content

Auto-generate image width and height into html #650

@axelson

Description

@axelson
  • This feature is not on the latest version

Request

I'd like to bring back something like [autoresize], it was first added in #116 but it appears to have been removed in 484880a

So using FastImage/ImageMagick, read out the file width and height, then insert that into the generated html.

Examples

I envision it working similar to:

{% asset mountains.jpg autosize=true responsive:automatic=true %}

This would generate html like:

<img src="/assets/e62518-7c6e59a6b1d1842b0abdcc30eb6bd1fa2d2eb6613fa226e1da209e17c96da356c25a9219431c207aa9aafe6be18852349838eb9d3c384d71d924e37586e8227e.jpg" srcset="/assets/2b8ae5-e8bf034164d498060726952ca8604a4ecd5a740c5a0687bf3171db0cee777516898b9aaf5e36f5015593c85da99391faacba5abd20a30d4dadf1d9df8b7b4276.jpg 2x" width="600" height="400">

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions