Last active
November 8, 2021 17:37
-
-
Save tristolliday/3755d495e3d01b440f461ba4c2132955 to your computer and use it in GitHub Desktop.
Umbraco 8 Optimised image
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @* | |
| Image Processor's WebP plugin must be installed via nuget first. | |
| https://www.nuget.org/packages/ImageProcessor.Plugins.WebP/ | |
| *@ | |
| <picture> | |
| <source srcset="@Model.Image.GetCropUrl(300, 300, furtherOptions: "&format=webp&quality=80")" type="image/webp"> | |
| <img src="@Model.Image.GetCropUrl(300, 300)" width="300" height="300" loading="lazy" alt="@Model.Image.Name" /> | |
| </picture> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment