I’m currently implementing cloudinary’s fetch mechanism (r/http://cloudinary + yourImageUrlHere) to resize images in my dotnet core application. For local development these files are stored locally (in my case I’m storing them in Azure Storage) and so they can’t be passed onto cloudinary’s fetch.
My solution to this is I’ve created a tag helper (a control that you pass in your image source url and the resize width). I’m detecting if the absolute image url is coming from a local connection (ie contains localhost address). I’m then excluding the cloudinary fetch url and just returning the image source url. This means the image is not being resized. It’s not ideal as I’ve introduced two different sets of behaviour into my application.
I assume this is a common problem.
Has anyone else come across this? I’m interested to hear how people have solved this problem. My thoughts are to introduce a local resize method as a fallback.