{"id":19708020,"url":"https://github.com/larrabee/online-image-resizer","last_synced_at":"2026-05-05T10:34:59.854Z","repository":{"id":82032105,"uuid":"100782015","full_name":"larrabee/online-image-resizer","owner":"larrabee","description":"On-the-fly image resizing using Node.js, libvips and nginx for caching.","archived":false,"fork":false,"pushed_at":"2017-08-24T10:36:33.000Z","size":10,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-10T13:13:44.462Z","etag":null,"topics":["image","libvips","nginx","nodejs","online","resize"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/larrabee.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-08-19T08:45:41.000Z","updated_at":"2017-08-24T10:32:32.000Z","dependencies_parsed_at":null,"dependency_job_id":"17b2621f-e50c-42ca-bc33-61d74cd6cb36","html_url":"https://github.com/larrabee/online-image-resizer","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/larrabee%2Fonline-image-resizer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/larrabee%2Fonline-image-resizer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/larrabee%2Fonline-image-resizer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/larrabee%2Fonline-image-resizer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/larrabee","download_url":"https://codeload.github.com/larrabee/online-image-resizer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241024420,"owners_count":19896227,"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":["image","libvips","nginx","nodejs","online","resize"],"created_at":"2024-11-11T21:40:42.652Z","updated_at":"2026-05-05T10:34:59.812Z","avatar_url":"https://github.com/larrabee.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Online Image Resizer\n\n## Instal steps\n1. Build and run docker image\n2. Configure frontend\n3. Enjoy!\n\n## Build docker image\n1. Clone this repo to PC with `git clone https://github.com/larrabee/online-image-resizer.git`\n2. Change parrams in `server.js` (not needed for most cases)\n3. Build docker container: `cd resizer \u0026\u0026 docker build -t resizer .`\n4. Run it with `docker run -d -p 7075:7075 resizer` or use docker-compose config:\n```\nversion: '2'\nservices:\n  resizer:\n      image: resizer\n      network_mode: host\n      container_name: \"resizer\"\n      restart: always\n      environment:\n         UV_THREADPOOL_SIZE: 64\n```\n\n## Configure frontend\nThis is basic Nginx config (nginx.conf) for online resizing with nginx cache.\n```\nevents {\n}\n\nhttp {\n    proxy_cache_path /var/www/resize_cache levels=1:2 \n    keys_zone=resized_img:64m inactive=48h max_size=5G use_temp_path=off;\n\n    server {\n        listen       80;\n        server_name  example.com;\n        root /var/www/example.com/;\n\n        location /img/ {\n           location ~* \\.(jpg|jpeg|png|ico)(\\@[0-9xX]+)$ {\n             proxy_pass http://localhost:7075; #Node with running image resizer\n             proxy_set_header X-RESIZE-SCHEME \"http\";\n             proxy_set_header X-RESIZE-BASE \"example.com\";\n             #Nginx cache. Optional\n             proxy_cache_valid  200 48h;\n             proxy_cache_valid  404 400 5m;\n             proxy_cache_valid 500 502 503 504 10s;\n             add_header X-Cache-Status $upstream_cache_status;\n             proxy_cache resized_img;\n           }\n        }\n    }\n}\n```\nYou must set:\n1. Replace `localhost:7075` with your hostname and port if you ran resizer in different node.\n2. Set `X-RESIZE-SCHEME \"http\"` if your image server with original images run over http (by default use https). \n3. Set you image server hostname here: `X-RESIZE-BASE \"example.com\"`\n\n## Enjoy!\n* Upload [test image](http://www.publicdomainpictures.net/pictures/110000/velka/green-mountain-valley.jpg) to `/img/test.jpg` on your server\n* Get original image [http://example.com/img/test.jpg](http://example.com/img/test.jpg) (naturally it must be present on your server).\n* Get resized to 1280x720 version [http://example.com/img/test.jpg@1280](http://example.com/img/test.jpg@1280) (height resolution will be calculate automatically)\n* Another way: [http://example.com/img/test.jpg@x720](http://example.com/img/test.jpg@x720) (width resolution will be calculate automatically)\n* Get resized to 500x500 version (image will be resized and striped to 500x500) [http://example.com/img/test.jpg@500x500](http://example.com/img/test.jpg@500x500)\n* Performance: Our resize node with 4 CPU cores process ~ 30-60 png images per second (based on image resolution).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flarrabee%2Fonline-image-resizer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flarrabee%2Fonline-image-resizer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flarrabee%2Fonline-image-resizer/lists"}