﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	uname	nginx_version
1015	image_filter module failure to perform image_filter_jpeg_quality step	Robert Kenny		"When nginx is built from source to include the image_filter module as follows:

{{{
apt-get -y update

apt-get -y install imagemagick libreadline-dev libncurses5-dev libpcre3-dev libssl-dev perl make build-essential libgd2-xpm-dev

cd /usr/local/src

wget http://luajit.org/download/LuaJIT-2.0.4.tar.gz
tar -zxvf LuaJIT-2.0.4.tar.gz
cd /usr/local/src/LuaJIT-2.0.4
make
make install

cd /usr/local/src

wget https://github.com/openresty/set-misc-nginx-module/archive/v0.30.tar.gz
tar -zxvf v0.30.tar.gz

wget https://github.com/simpl/ngx_devel_kit/archive/v0.3.0.tar.gz
tar -zxvf v0.3.0.tar.gz

wget https://github.com/openresty/lua-nginx-module/archive/v0.10.5.tar.gz
tar -zxvf v0.10.5.tar.gz

wget http://zlib.net/zlib-1.2.8.tar.gz
tar -zxvf zlib-1.2.8.tar.gz

wget http://nginx.org/download/nginx-1.11.1.tar.gz
tar -zxvf nginx-1.11.1.tar.gz

cd /usr/local/src/nginx-1.11.1

# tell nginx's build system where to find LuaJIT 2.0:
export LUAJIT_LIB=/usr/local/lib
export LUAJIT_INC=/usr/local/include/luajit-2.0

./configure --sbin-path=/usr/local/nginx/nginx --conf-path=/usr/local/nginx/nginx.conf --pid-path=/usr/local/nginx/nginx.pid --with-http_image_filter_module --with-http_ssl_module --with-zlib=/home/ubuntu/zlib-1.2.8 --with-ld-opt=""-Wl,-rpath,/usr/local/lib"" --add-module=/usr/local/src/ngx_devel_kit-0.3.0 --add-module=/usr/local/src/lua-nginx-module-0.10.5 --add-module=/usr/local/src/set-misc-nginx-module-0.30
make -j2
make install
}}}

With the following config:

{{{
worker_processes auto;

events {
    worker_connections 768;
}

http {
    charset utf-8;
    proxy_intercept_errors on;
    include       mime.types;
    default_type  application/octet-stream;

    server {
        listen       80;

        location / {
           image_filter_buffer 200M;
           image_filter_interlace on;
           image_filter_jpeg_quality $arg_q;

           proxy_pass https://raw.githubusercontent.com/guardian/grid/master/docs/images/screenshot-2015-07-03T11%3A34%3A43.jpg;
        }
    }
}
}}}

Requests for images seem not to be run through the image_filter module (i.e. there is no quality reduction). In addition attempting to perform a resize (""image_filter resize $arg_w $arg_h"") causes a 415 error consistently.

'''Notes:'''

The reason for not using the 'nginx' and 'nginx-extras' packages is that I also require the lua module and set_misc. I have also attempted to build Openresty with the image_filter module (as it's a bit less fiddly than the above) with similar effects.

"	defect	closed	minor		nginx-module	1.11.x	invalid	image_filter		Linux ip-172-31-19-164 4.2.0-41-generic #48-Ubuntu SMP Fri Jun 24 11:28:43 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux	nginx version: nginx/1.11.1
