Dynamic Image Transformation Module For Nginx.
C C++ Perl
Switch branches/tags
Nothing to show
Pull request Compare This branch is 314 commits behind cubicdaiya:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.gitignore
COPYING
README.md
config.in
ngx_http_small_light_imagemagick.c
ngx_http_small_light_imagemagick.h
ngx_http_small_light_module.c
ngx_http_small_light_module.h
ngx_http_small_light_param.c
ngx_http_small_light_param.h
ngx_http_small_light_parser.c
ngx_http_small_light_parser.h
ngx_http_small_light_size.c
ngx_http_small_light_size.h
setup

README.md

ngx_small_light

ngx_small_light is a dynamic image transformation module for Nginx. And ngx_small_light is written for using as the same way as mod_small_light as possible in Nginx.(mod_small_light is a Apache module)

Dependencies

Build

cd ${ngx_small_light_src_dir}
./setup
cd {$nginx_src_dir}
./configure --with-pcre --add-module=${ngx_small_light_src_dir}
make
make install

Configuration Example

server {
    listen 8000;
    server_name localhost;

    small_light on;
    small_light_pattern_define msize dw=500,dh=500,da=l,q=95,e=imagemagick,jpeghint=y;
    small_light_pattern_define ssize dw=120,dh=120,da=l,q=95,e=imagemagick,jpeghint=y;

    # http://localhost:8000/small_light(p=msize)/img/filename.jpg -> generate msize image
    # http://localhost:8000/small_light(p=ssize)/img/filename.jpg -> generate ssize image
    # http://localhost:8000/small_light(of=gif,q=100)/img/filename.jpg -> generate gif image which quality is 100
    location ~ small_light[^/]*/(.+)$ {
        set $file $1;
        rewrite ^ /$file;
    }
} 

Todo

  • support Imlib2 and GD
  • add various convenient options
  • make documentations