By default, the blob datas for media will be the same as you uploaded by calling the blob url:
/public/blob?id=4277b1e4-f50b-487d-b535-470d3b693217
To resize images, add these parameters:
Example url might be: /public/blob?id=4277b1e4-f50b-487d-b535-470d3b693217&w=250&h=250
To secure and prevent flooding the media cache, the allowed dimensions must be configured in the appsettings. Otherwise it will be ignored.
{
"NLESS.IO": {
"ImageResizing": {
"AllowOriginalDimension": true,
"AllowedDimensions": [
{
"Width": 250,
"Height": 250
},
{
"Width": 400,
"Height": 250
},
{
"Width": 400,
"Height": 400
},
{
"Width": 1920,
"Height": 600
}
]
}
}
}
For generating the media url, there is a helper method:
<img src="@imageUrl?.Url(width: 250, height: 250)"/>