{"id":18019054,"url":"https://github.com/gnuns/crops","last_synced_at":"2025-03-26T20:31:16.340Z","repository":{"id":97555223,"uuid":"83936936","full_name":"gnuns/crops","owner":"gnuns","description":":sunrise_over_mountains: Image thumbnail generation server","archived":false,"fork":false,"pushed_at":"2017-10-24T20:02:19.000Z","size":17,"stargazers_count":37,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-22T10:24:25.270Z","etag":null,"topics":["crop","crop-image","image","image-processing","imagemagick","thumbnail","thumbnails"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/gnuns.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-03-05T01:40:06.000Z","updated_at":"2020-06-16T00:09:42.000Z","dependencies_parsed_at":"2024-03-10T22:32:46.269Z","dependency_job_id":null,"html_url":"https://github.com/gnuns/crops","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/gnuns%2Fcrops","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gnuns%2Fcrops/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gnuns%2Fcrops/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gnuns%2Fcrops/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gnuns","download_url":"https://codeload.github.com/gnuns/crops/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245731359,"owners_count":20663159,"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":["crop","crop-image","image","image-processing","imagemagick","thumbnail","thumbnails"],"created_at":"2024-10-30T05:08:58.303Z","updated_at":"2025-03-26T20:31:16.334Z","avatar_url":"https://github.com/gnuns.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Crops\nSimple thumbnail generation server\n\n### Clone \u0026 install dependencies\n```sh\nsudo apt-get install imagemagick graphicsmagick\ngit clone git@github.com:gnuns/crops.git\ncd crops/\nnpm install\n```\n\n### Usage:\nSet the .env variables:\n```\nPORT=1337\nBASE_SERVER=http://cdn.example.com/\n```\n\nRun!\n```\nnpm start\n```\n\nTo crop the image:\n`http://cdn.example.com/blah/awsome/potatoe.jpg`\n\nYou just have to access\n`http://localhost:1337/crop/200/400/blah/awsome/potatoe.jpg`\n\n\nYou can also set the crop gravity:\n`http://localhost:1337/crop/200/400/blah/awsome/potatoe.jpg?gravity=North` or\n`http://localhost:1337/crop/200/400/blah/awsome/potatoe.jpg?gravity=2`\n\nAnd quality (1-100):\n`http://localhost:1337/crop/200/400/blah/awsome/potatoe.jpg?quality=70`\n\nBy default, Crops use quality = 100 and [smartcrop](https://github.com/jwagner/smartcrop.js) to define the best gravity\n\n\n#### Valid gravity values:\n| Code  | Name  |\n| --- | --- |\n| 0 | Center |\n| 1 | NorthWest |\n| 2 | North |\n| 3 | NorthEast |\n| 4 | West  |\n| 5 | East  |\n| 6 | SouthWest |\n| 7 | South |\n| 8 | SouthEast |\n| 9 | **Smart**  (default) |\n\n\n### Live demo\n\nI setup a live demo on heroku  with `BASE_SERVER` param as `http://`, so you can view a cropped version of any image on the web using the URL without http://\n\nAddress: `https://crops.herokuapp.com/crop/`\n\n#### Example:\n\n![Original cat](http://68.media.tumblr.com/4e097c1aba3644c09121b28c3fc2d468/tumblr_mgtkitzs2I1qlp8dho1_1280.jpg)\n\n`Image: http://68.media.tumblr.com/4e097c1aba3644c09121b28c3fc2d468/tumblr_mgtkitzs2I1qlp8dho1_1280.jpg`\n\n![Square cat](https://crops.herokuapp.com/crop/300/300/68.media.tumblr.com/4e097c1aba3644c09121b28c3fc2d468/tumblr_mgtkitzs2I1qlp8dho1_1280.jpg?quality=70)\n\n`70% quality 300x300 image: https://crops.herokuapp.com/crop/300/300/68.media.tumblr.com/4e097c1aba3644c09121b28c3fc2d468/tumblr_mgtkitzs2I1qlp8dho1_1280.jpg?quality=70`\n\n## credits\ninspired by [zooniverse/static-crop](https://github.com/zooniverse/static-crop)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgnuns%2Fcrops","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgnuns%2Fcrops","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgnuns%2Fcrops/lists"}