-
Case Using ImageSharp.Web We can server jpg images like this: http://example.com/img/pic1.jpg?width=10 SVG I would like to request SVG images on the same path like this: http://example.com/img/logo.svg This will result in a 404 response 😔 How do I configure ImageSharp just to bypass all logic and retur the original SVG file? |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 7 replies
-
That shouldn’t happen. Did you register the middleware after the static file middleware or something? |
Beta Was this translation helpful? Give feedback.
-
Please note that the base path "http://example.com/img/" is the same for both jpg and svg files. Otherwise it's a quite basic setup:
|
Beta Was this translation helpful? Give feedback.
-
Thanks for pitching in @tocsoft I'm wondering whether it would be preferable for me to write a custom "component" for ImageSharp that will read the SVG file and just serve the original file in the same way a jpg file is handled when no query string parameters are present. Got any recommendations or pointers to share? |
Beta Was this translation helpful? Give feedback.
-
Thanks you both - hacking ImageSharp to our needs seems a bad way to go. |
Beta Was this translation helpful? Give feedback.
-
Hi, Came here for a similar reason. We are upgrading to Umbraco v13 which uses ImageSharp, previously had ImageProcessor. Images are coming from the CMS and going through a helper, so there will be instances where the image is svg or raster. So the src might turn up as /media/gd2dtyto/logoimage.svg?quality=90&width=600&format=jpg&mode=max In our example though we are getting a 500 rather than 404. without the format=jpg it works (assuming it's skipping imagesharp in those instances?) Is there a pattern for upgrade in these types of scenarios or a link to some docs please about what is suggested above regarding the handler? Thanks, |
Beta Was this translation helpful? Give feedback.
Thanks for pitching in @tocsoft
You are right - the svg files are in the same blob storage.
Your explanation on how ImageSharp i architected make perfect sence.
I'm wondering whether it would be preferable for me to write a custom "component" for ImageSharp that will read the SVG file and just serve the original file in the same way a jpg file is handled when no query string parameters are present.
Got any recommendations or pointers to share?