This example uses a config-bundle, but also specifies additional parameters in Link.Image(...)
.
@inherits Custom.Hybrid.Razor14
@{
var imgUrl = App.Path + "/assets/img-resize/basic-logo.png";
var imgUrl2 = App.Path + "/assets/img-resize/basic-banner.png";
var customSettingsMax = AsDynamic(new {
Height = 300,
Width = 100,
ResizeMode = "Max"
});
}
<img loading="lazy" src='@Link.Image(imgUrl, customSettingsMax, format: "jpg", quality: 1)'> -
<img loading="lazy" src='@Link.Image(imgUrl, customSettingsMax, format: "jpg", quality: 10)'> -
<img loading="lazy" src='@Link.Image(imgUrl, customSettingsMax, format: "jpg", quality: 75)'>