Lua, memc and image_filter, image not resized via lua

Markus Jelsma markus.jelsma at openindex.io
Sat Sep 15 12:21:54 UTC 2012


Ilja, agentzh, 

Thanks for sharing your comments. I was afraid it would be a phase issue. I'll check the toolkit and LuaGD. 


 
 
-----Original message-----
> From:Ilja Razinkov <razinkov at gmail.com>
> Sent: Sat 15-Sep-2012 08:59
> To: nginx at nginx.org
> Subject: Re: Lua, memc and image_filter, image not resized via lua
> 
> You may consider user lua-gd, http://ittner.github.com/lua-gd/, which
> works just fine with LuaNginx
> We making crop+resize+masking of user-uploaded images in lua handlers
> with no problems
> 
> On Sat, Sep 15, 2012 at 10:15 AM, agentzh <agentzh at gmail.com> wrote:
> > Hello!
> >
> > On Fri, Sep 14, 2012 at 3:22 PM, agentzh <agentzh at gmail.com> wrote:
> >>
> >> This is because the standard ngx_image_filter module's output filter
> >> always runs *after* ngx_lua's subrequest capturing filter and there's
> >> no easy way to change this order. The response body of your subrequest
> >> is captured by ngx_lua *before* the ngx_image_filter's filter gets a
> >> chance to run.
> >>
> >
> > BTW, I've also just written a command-line utility named
> > ngx-body-filters that can dump out all the output body filters of any
> > running Nginx worker processes (on Linux) in the order they actually
> > run.
> >
> > This tool is part of my Nginx SystemTap Toolkit:
> >
> >     https://github.com/agentzh/nginx-systemtap-toolkit#ngx-body-filters
> >
> > For example, on my side, the nginx configured with both the ngx_lua
> > and ngx_image_filter modules will give me the following result:
> >
> >     $ ./ngx-body-filters -p 30132
> >     Tracing 30132 (.../nginx/sbin/nginx)...
> >
> >     ngx_http_range_body_filter
> >     ngx_http_copy_filter
> >     ngx_output_chain
> >     ngx_http_lua_capture_body_filter
> >     ngx_http_image_body_filter
> >     ngx_http_charset_body_filter
> >     ngx_http_ssi_body_filter
> >     ngx_http_postpone_filter
> >     ngx_http_gzip_body_filter
> >     ngx_http_chunked_body_filter
> >     ngx_http_write_filter
> >
> >     113 microseconds elapsed in the probe handler.
> >
> > where my nginx worker process pid is 30132.
> >
> > From this output, we can see clearly that
> > ngx_http_lua_capture_body_filter indeed runs before
> > ngx_http_image_body_filter.
> >
> > So this tool is really handy in determining if there is an issue with
> > the nginx output filter running order, which is often not so obvious
> > for many users.
> >
> > Best regards,
> > -agentzh
> >
> > _______________________________________________
> > nginx mailing list
> > nginx at nginx.org
> > http://mailman.nginx.org/mailman/listinfo/nginx
> 
> 
> 
> -- 
> с уважением, Разинков Илья
> 
> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx



More information about the nginx mailing list