Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto-generate image width and height into html #650

Open
1 task done
axelson opened this issue Nov 19, 2020 · 0 comments
Open
1 task done

Auto-generate image width and height into html #650

axelson opened this issue Nov 19, 2020 · 0 comments

Comments

@axelson
Copy link

axelson commented Nov 19, 2020

  • 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">
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant