imgio
imgio copied to clipboard
Add support to rewrite img tags
If we build imgio into a middleware, we could provide support to automatically rewrite image tags like so. From:
<img width="120" height="240" src="http://domain.com/an/image.png">
into
<img width="120" height="240" src="http://<myimageioserver>/120/240/http://domain.com/an/image.png">
That is a great idea. It yields some questions:
- Do all images get rewritten?
- How to configure the rewriting?
- Do you have an actual use case for imgio-as-a-middleware? (Because I ain't. Decision making would be easier for me to see it in action within a real world application)
I think it would be great to rewrite images that have special markers like a class="cdn"
.
To think this a bit further, I'd propose the following middleware-stack:
⇅ imgio
⇅ img-rewriter
⇅ An application