Skip to content

walf443/ngx_small_light

 
 

Repository files navigation

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

About

Dynamic Image Transformation Module For Nginx.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C 93.2%
  • C++ 5.8%
  • Perl 1.0%