{"id":13859228,"url":"https://github.com/spacechop/spacechop","last_synced_at":"2025-03-25T07:31:33.641Z","repository":{"id":57161814,"uuid":"145254972","full_name":"spacechop/spacechop","owner":"spacechop","description":"HTTP service for high-level image processing with first-class Docker support.","archived":false,"fork":false,"pushed_at":"2020-06-02T18:25:09.000Z","size":12903,"stargazers_count":145,"open_issues_count":32,"forks_count":15,"subscribers_count":8,"default_branch":"master","last_synced_at":"2024-08-10T10:56:47.742Z","etag":null,"topics":["docker-container","image-processing","imagemagick","performance"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/spacechop.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-08-18T21:50:47.000Z","updated_at":"2024-03-25T19:07:27.000Z","dependencies_parsed_at":"2022-09-09T04:50:28.484Z","dependency_job_id":null,"html_url":"https://github.com/spacechop/spacechop","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spacechop%2Fspacechop","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spacechop%2Fspacechop/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spacechop%2Fspacechop/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spacechop%2Fspacechop/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/spacechop","download_url":"https://codeload.github.com/spacechop/spacechop/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":222052663,"owners_count":16922752,"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":["docker-container","image-processing","imagemagick","performance"],"created_at":"2024-08-05T03:02:38.046Z","updated_at":"2024-10-29T13:08:35.505Z","avatar_url":"https://github.com/spacechop.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"# [SpaceChop](https://spacechop.com) [![npm version](https://badge.fury.io/js/%40spacechop%2Ftypes.svg)](https://badge.fury.io/js/%40spacechop%2Ftypes) [![Docker](https://img.shields.io/badge/docker-spacechop/spacechop-blue.svg)](https://hub.docker.com/r/spacechop/spacechop/) [![Docker Registry](https://img.shields.io/docker/pulls/spacechop/spacechop.svg)](https://hub.docker.com/r/spacechop/spacechop/) [![](https://images.microbadger.com/badges/image/spacechop/spacechop.svg)](https://microbadger.com/images/spacechop/spacechop)\nSpaceChop is a Docker container for processing your images through HTTP requests.\n\n**🔒 Secure** - Dont allow everyone to create arbitrary image transformations and overload your server.\n\n**📦 Storage** - Store original and transformed images on the infrastructure you are already using. For example Amazon S3, HTTP server, or local volume.\n\n**👨‍💻 For developers** - Set up available transformations via yaml files.\n\nAt [spacechop.com](https://spacechop.com), you can get for the hosted solution of SpaceChop which includes CDN, storage, caching, database, statistics and analytics for your service.\n\nTo get started with SpaceChop, [**go to our documentation website**](https://spacechop.gitbook.io/spacechop/).\n\n## Installation\nThe recommended way to use SpaceChop is via docker-compose:\n\n`docker-compose.yml`\n```yaml\nversion: '3'\nservices:\n  spacechop:\n    container_name: spacechop\n    image: spacechop/spacechop:latest\n    ports:\n      - 8080:3000\n    volumes:\n      - ./config.yml:/config.yml\n```\n\n`config.yml`\n```yaml\npaths:\n  - /:preset/:image(.*)\nsources:\n  - http:\n      root: https://upload.wikimedia.org/wikipedia/commons/:image\npresets:\n  # fill 200x200 with type jpeg and compress with quality 0.9\n  t_200:\n    steps:\n      - $fill:\n          width: 200\n          height: 200\n      - $format:\n          type: jpeg\n      - $compress:\n          quality: 90\n\n```\n\n```sh\n# start the service using docker-compose\ndocker-compose up -d\n\n# check the logs for help with your configuration and see what's happening\ndocker-compose logs -f spacechop\n```\n\nGo to `http://localhost:8080/t_200/c/c4/Photo_Wallet_product.jpg` in your browser and you should see an image fetched from Wikimedia and transformed with the above preset `t_200`. \n**You just successfully transfomed your first image using SpaceChop!**\n\n## Getting started\n\nYou will at least need a path, source and preset to get started.\n\n### paths and sources\n\nPaths and sources are interlinked and work together using [`path-to-regex`](https://github.com/pillarjs/path-to-regexp) with support for ()-matching groups. Use the path [express-route-tester](http://forbeslindesay.github.io/express-route-tester/) with version **2.0.0** to see what works.\n\nBasically how it works is that the path you request at http://localhost:8080/t_200/your-unique-path/with-slashes/to-and-image-url.jpg will look through your sources until it finds an image for your root url (if you are using the http source).\n\ni.e.  \nhttp://localhost:8080/t_200/your-unique-path/with-slashes/to-and-image-url.jpg\nwill in the above configuration look at:\nhttp://commons.wikipedia.org/your-unique-path/with-slashes/to-and-image-url.jpg\n\nNotice the usage of :image in paths and sources, you can change this to whatever makes sense for you in your matching. You can use your own variable names and matching in your sources.\n\nEach source has its own set of configuration to be able to lookup and download originals. You can [read more about each source in our documentation](https://spacechop.gitbook.io/spacechop/).\n\n### presets\n\nAs you might have seen there is a :preset variable in the path in the example configuration above, this is the only required variable in path that there is, and this will match the exact name of your preset in the configuration as you might have guessed.\n\nIn a preset there are steps which are composed of a list of operations with their unique set of options. You can [read more about each operation in our documentation](https://spacechop.gitbook.io/spacechop/).\n\n## Contributing\n\n[![Build Status](https://travis-ci.org/spacechop/spacechop.svg?branch=master)](https://travis-ci.org/spacechop/spacechop) [![codecov](https://codecov.io/gh/spacechop/spacechop/branch/master/graph/badge.svg)](https://codecov.io/gh/spacechop/spacechop) [![Greenkeeper badge](https://badges.greenkeeper.io/spacechop/spacechop.svg)](https://greenkeeper.io/) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](CONTRIBUTING.md)\n\n[Read the SpaceChop Contributor Guidelines.](CONTRIBUTING.md)\n\nRunning tests locally:\n\n```\nsh test.sh\n```\n\nor manually using docker-compose\n\n```\ndocker-compose up -d --build\ndocker-compose exec spacechop sh -c \"npm run test:watch\"\n```\n\nThis project uses TypeScript for static typing and TSLint for linting. You can get both of these built into your editor with no configuration by opening this project in [Visual Studio Code](https://code.visualstudio.com/), an open source IDE which is available for free on all platforms.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspacechop%2Fspacechop","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fspacechop%2Fspacechop","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspacechop%2Fspacechop/lists"}