Search code examples
.net-5asp.net-core-middlewareimagesharp

Imagesharp.Web Custom URL Pattern


I'm trying to map existing URL pattern to imagesharp.web to resize images.

I found a method to do that using URL rewrites. Other than that, Is there any standard way to map an existing URL pattern to an imagesharp.web URL pattern?

Existing URL Pattern:

https://{myDomain}/process_resize_{width}x{height}/{folder}/{filename.extension} 

URL accepted by Imagesharp.Web:

https://localhost:44397/5dd74c00631a76.86137975.jpeg?width=415&height=415&quality=30&rmode=max

Solution

  • You can implement your own version of IRequestParser and use whatever URL pattern you want.