JamesJJ / ngx_http_image_filter_module

ngx_http_image_filter_module modified per README.md

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ngx_http_image_filter_module

NGINX Image Filter Module

Modifications

Original source is from NGINX 1.11.13

Always process the source JPEG or PNG image

Original NGINX code would only resize the image if:

  • The source image exceeded the maximum width or height settings
    • OR
  • The JPEG meta-data exceeded 5% of the file size

Set ctx->force to ensure the image is always processed. This allows setting the output JPEG quality without changing the image dimensions

Output JPEG irrespective of whether the source image was PNG or JPEG

PNG was designed to be lossless and usually has larger file size. In my use case JPEG output is more appropriate.

To-Do

  1. Currently changes above are hard coded. These should be changed to configuration settings.
  2. Submit changes back to NGINX!

See also:

License

About

ngx_http_image_filter_module modified per README.md


Languages

Language:C 97.3%Language:PHP 1.4%Language:Shell 1.3%