Welcome! Log In Create A New Profile

Advanced

Re: Lua, memc and image_filter, image not resized via lua

Ilja Razinkov
September 15, 2012 02:56AM
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@gmail.com> wrote:
> Hello!
>
> On Fri, Sep 14, 2012 at 3:22 PM, agentzh <agentzh@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@nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx



--
с уважением, Разинков Илья

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Lua, memc and image_filter, image not resized via lua

Markus Jelsma September 12, 2012 11:00AM

RE: Lua, memc and image_filter, image not resized via lua

Markus Jelsma September 14, 2012 06:44AM

Re: Lua, memc and image_filter, image not resized via lua

agentzh September 14, 2012 02:12PM

Re: Lua, memc and image_filter, image not resized via lua

agentzh September 14, 2012 06:24PM

Re: Lua, memc and image_filter, image not resized via lua

agentzh September 15, 2012 02:16AM

Re: Lua, memc and image_filter, image not resized via lua

Ilja Razinkov September 15, 2012 02:56AM

RE: Lua, memc and image_filter, image not resized via lua

Markus Jelsma September 15, 2012 08:20AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 205
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready