On Thursday 14 July 2011 19:48:50 Stephen Fenwick-Paul wrote:
The reservation with my design is that I was forced to use a route outside of /public to transform the image.
I really would have liked to be able to,
if my original image was,
/images/fred.jpg
to have done the below to transform it
/images/fred.jpg?h=50&w=200
but I was forced to
/resize/images/fred.jpg?h=50&w=200
as Oleg effectively has
Is there a way of getting a user defined route to intercept a file in /public?
Assuming that you're not serving up static files directly via e.g. nginx, then I think a before filter should be able to catch requests that would otherwise have been served straight out of the public dir... maybe something vaguely like: before sub { if (request->path =~ m{^/images}) { handle_resize(); } }; I'm not sure that params will have been parsed, though, if it's being treated as a static route. I think the way you've implemented it is quite probably a better option. -- David Precious ("bigpresh") http://www.preshweb.co.uk/ "Programming is like sex. One mistake and you have to support it for the rest of your life". (Michael Sinz)