Yes, you are right, the approach is messy.
So the best way could be something like a module. The image URL is passed
as an argument, the module crunch the image and returns the correct URL.
So in code you have to write something like:
IMG(_src=responsive(URL('static','image.img')),_alt='test')
This way the programmer is aware of responsiveness and he could use the
feature where he wants!
The responsive module could be configure to use local cpu or a remote
service.
What do you think?
2012/1/11 Anthony <[email protected]>
> On Wednesday, January 11, 2012 12:16:50 PM UTC-5, AngeloC wrote:
>>
>> Thanks Anthony,
>>
>> Ok, this way I have to play anyway with urls. I'll try another approach.
>> There is a way to rewrite the page after rendering, just before the page
>> will be sent to the browser?
>>
>
> html = response.render()
> return replace_image_urls(html)
>
> or maybe WSGI middleware. But that approach seems messy (you have to parse
> all the html). And what about images linked from static files (e.g., CSS
> background images)?
>
> Anthony
>
--
Profile: http://it.linkedin.com/in/compagnucciangelo