OrchardCore: problem in using resize_url and caching
sometimes it shows a resized picture and doesn’t show an original file. I’m calling the original picture.
some times it doesn’t resize the picture
{% for pic in Model.ContentItem.Content.SportMatch.pictures.Paths %}
<a href="{{ pic | asset_url }}">
<img style="padding: 4px;" src="{{ pic | asset_url | resize_url: width:240, height:160, mode:'max' }}" alt="{{ Model.ContentItem.DisplayText }}" />
</a>
{% endfor %}
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 17 (13 by maintainers)
@Skrypt okay.
I fixed it in my PR through the
MediaFileProvider.IsValidRequest()that checks if there is at least one of the mandatory resizing parameters (width or height).I don’t think it’s related. We found that ImageSharp is also caching full sized images (that’s the issue found here). For the image gallery it is normal that it will show resized images if in the image gallery you are using a resize_url. You need to load full sized images in that case.