{"id":18903607,"url":"https://github.com/intaro/nginx-image-filter-watermark","last_synced_at":"2025-10-25T00:09:06.964Z","repository":{"id":13708677,"uuid":"16402626","full_name":"intaro/nginx-image-filter-watermark","owner":"intaro","description":"Patched image_filter module for Nginx with watermark ability","archived":false,"fork":false,"pushed_at":"2019-02-06T20:04:03.000Z","size":23,"stargazers_count":84,"open_issues_count":7,"forks_count":43,"subscribers_count":23,"default_branch":"master","last_synced_at":"2023-08-12T17:32:23.795Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/intaro.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-01-31T07:53:47.000Z","updated_at":"2023-06-25T09:48:16.000Z","dependencies_parsed_at":"2022-09-06T12:12:52.994Z","dependency_job_id":null,"html_url":"https://github.com/intaro/nginx-image-filter-watermark","commit_stats":null,"previous_names":[],"tags_count":0,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/intaro%2Fnginx-image-filter-watermark","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/intaro%2Fnginx-image-filter-watermark/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/intaro%2Fnginx-image-filter-watermark/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/intaro%2Fnginx-image-filter-watermark/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/intaro","download_url":"https://codeload.github.com/intaro/nginx-image-filter-watermark/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223657849,"owners_count":17181024,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-08T09:05:53.008Z","updated_at":"2025-10-25T00:09:06.887Z","avatar_url":"https://github.com/intaro.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"Nginx-image-filter-watermark\n============================\n\nPatched `image_filter_module` for Nginx with watermark ability. Patch based on [http_image_filter_module](http://nginx.org/en/docs/http/ngx_http_image_filter_module.html)\n\nShould work properly on nginx \u003e= 1.11.6.\n\n### Available options:\n\n```\nimage_filter watermark;\n\nimage_filter_watermark_width_from 300;\nimage_filter_watermark_height_from 400;\n    \nimage_filter_watermark \"PATH_TO_FILE\";\nimage_filter_watermark_position center-center; # top-left|top-right|bottom-right|bottom-left|right-center|left-center|bottom-center|top-center|center-center|center-random`\n```\n\n`image_filter_watermark_width_from` - Minimal width image (after resize and crop) of when to use watermark.\n`image_filter_watermark_height_from` - Minimal height image (after resize and crop) of when to use watermark.\n\nIf width or height image (after resize and crop) more then `image_filter_watermark_height_from` or `image_filter_watermark_width_from` then image gets watermark.\n\n`image_filter_watermark` - path to watermark file.\n`image_filter_watermark_position` - position of watermark, available values are `top-left|top-right|bottom-right|bottom-left|right-center|left-center|bottom-center|top-center|center-center|center-random`.\n\n### Install\n\nGet source code and replace  module file in\n`nginx/src/http/modules/http_image_filter_module.c`\n\nBuild nginx with module.\n\n```\n/configure --with-http_image_filter_module\nmake\nmake install\n```\n\n\n### Example Usage\n\nBase Usage:\n\n```\n    location /img/ {\n        image_filter watermark;\n\n        image_filter_watermark \"PATH_TO_FILE\";\n        image_filter_watermark_position center-center;\n    }\n```\n\nUsage with resize and crop:\n\n```\n   location ~ ^/r/(\\d+|-)x(\\d+|-)/c/(\\d+|-)x(\\d+|-)/(.+) {\n       set                         $resize_width  $1;\n       set                         $resize_height $2;\n       set                         $crop_width  $3;\n       set                         $crop_height $4;\n\n       alias                       /PATH_TO_STATIC/web/$5;\n       try_files                   \"\" @404;\n\n       image_filter                resize $resize_width $resize_height;\n       image_filter                crop   $crop_width $crop_height;\n\n       image_filter_jpeg_quality   95;\n       image_filter_buffer         2M;\n\n       image_filter_watermark_width_from 400;   # Minimal width (after resize) of when to use watermark\n       image_filter_watermark_height_from 400;  # Minimal height (after resize) of when to use watermark\n\n       image_filter_watermark \"PATH_TO_FILE\";\n       image_filter_watermark_position center-center;\n   }\n```\n\n### Example test memory leaks\n\n```\nab -n 3000 -c 10 -k  http://image-resize.local/r/500x-/some-file.jpg\n```\n\nWhile there is a load test,  track at how the RAM behaves\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fintaro%2Fnginx-image-filter-watermark","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fintaro%2Fnginx-image-filter-watermark","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fintaro%2Fnginx-image-filter-watermark/lists"}