image_filter enhancement

Maxim Dounin mdounin at
Wed Dec 5 14:52:44 UTC 2012


On Tue, Dec 04, 2012 at 06:58:17PM +0400, ivan babrou wrote:

> >
> > Additionally, looking at the code I tend to think it's incorrect.
> > That is, it's pattern you've followed is incorrect, not your code.
> > E.g. the following config will result in $arg_q incorrectly used
> > for quality in /image/, instead of "80" explicitly set:
> >     image_filter_jpeg_quality $arg_q;
> >     location /image/ {
> >         image_filter crop $arg_w $arg_h;
> >         image_filter_jpeg_quality 80;
> >     }
> > This needs fixing.
> As I see other config variables are buggy too. Should I fix them too?

It would be fine to produce a patch which fixes existing config 
variables, and the patch to add crop offsets on top of it.

> Anyway, this is latest version of my patch where I fixed other issues:

I don't see at least some of previously expressed points 
addressed, so I assume you are still working on it.

Please also see other point rightfully noted by Ruslan Khusnullin - 
you can't use ngx_strcmp() in ngx_http_image_filter_get_value() as 
it's used not only on null-terminated strings.

Maxim Dounin

More information about the nginx-devel mailing list