imgio icon indicating copy to clipboard operation
imgio copied to clipboard

Add support to rewrite img tags

Open radiospiel opened this issue 13 years ago • 1 comments

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"> 

radiospiel avatar Feb 14 '12 14:02 radiospiel

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

Overbryd avatar Feb 15 '12 15:02 Overbryd