On Wednesday, January 11, 2012 11:49:18 AM UTC-5, AngeloC wrote: > > Thanks Bruno, > > These not solve my problem! To use thumbor, I have to prepare links using > a special syntax, that is what I want to avoid. If I wanted to change links > I would have done using responsive design tecniques and my own webserver! > > @Antony: > I know sencha and it adopts an approch like the one I proposed, they have > a proxy that intercepts requests to images and resize them basing on the > knowledge of the device they have by the useragent. The only caveat is that > you have to change all of your urls! > > I think that we have a framework, we have user_agent_parser and we can > include responsive images in web2py! > If we can intercept GET to images, we can build something totally > integrated with web2py! And this is what I'm doing! > I'm thinking of a responsive design module for web2py that can be > configured (local processor power with PIL, online service like thumbor) > and when plugged in, it makes automatically responsive all of your images. > > So, my question is, there is a way to intercept GET to static image files? >
Assuming web2py is serving static files to begin with, I believe it does so very early in the process, before the session is read, etc. If you can add a flag to the URL (e.g., in the query string) only in cases where you need to offer the alternative (non-static) image, maybe you could handle that via the pattern-based rewrite system in routes.py (though that would prevent using the parameter-based system for other purposes). Anthony

