https://github.com/globocom/thumbor
On Wed, Jan 11, 2012 at 2:16 PM, Angelo Compagnucci < angelo.compagnu...@gmail.com> wrote: > Hi guys, > > For a web application, I have to implement a sort of responsive design for > images. There are tons of solution online, but they requires to use some > sort of javascript and custom html to work (insert special tags or classes > in code). I don't like the approch because it make the code unmaintenable. > > The idea I have in mind is something like this: > > 1) On page load, a jquery function calls a controller and communicates > infos about the device. > 2) Controller stores those infos in session > 3) I intercept images download and > 3a) If there are session infos about device width and is_mobile, I resize > the image with PIL to the exact width server side and give the new url to > the response. > 3b) If there aren't infos (browser doesn't support cookies) and is_mobile, > I resize the image to an arbitrary small size (ex: 480 px) and give the new > url to the response. > 3c) If !is_mobile, I return the normal url > > How can I intercept file download also the static ones? > > Thank you! > > -- > Profile: http://it.linkedin.com/in/compagnucciangelo > -- Bruno Rocha [http://rochacbruno.com.br]