{"id":19125426,"url":"https://github.com/aracki/goimage","last_synced_at":"2025-07-21T12:39:36.006Z","repository":{"id":57646985,"uuid":"139598481","full_name":"Aracki/goimage","owner":"Aracki","description":"Serverless function written in Golang for image processing - ready for AWS Lambda","archived":false,"fork":false,"pushed_at":"2018-09-05T09:16:18.000Z","size":3253,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-04-17T13:03:06.515Z","etag":null,"topics":["aws-lambda","go","image-crop","image-processing","image-resize"],"latest_commit_sha":null,"homepage":"","language":"Go","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/Aracki.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}},"created_at":"2018-07-03T14:50:05.000Z","updated_at":"2023-09-20T10:02:58.000Z","dependencies_parsed_at":"2022-09-19T06:20:46.764Z","dependency_job_id":null,"html_url":"https://github.com/Aracki/goimage","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Aracki/goimage","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aracki%2Fgoimage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aracki%2Fgoimage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aracki%2Fgoimage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aracki%2Fgoimage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Aracki","download_url":"https://codeload.github.com/Aracki/goimage/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aracki%2Fgoimage/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266303649,"owners_count":23908373,"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","status":"online","status_checked_at":"2025-07-21T11:47:31.412Z","response_time":64,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["aws-lambda","go","image-crop","image-processing","image-resize"],"created_at":"2024-11-09T05:35:44.068Z","updated_at":"2025-07-21T12:39:35.985Z","avatar_url":"https://github.com/Aracki.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# goimage\n\n## Installation\n\n`go get -d github.com/Aracki/goimage...`\n\n## AWS Configuration\n\nYou will need to configure AWS services.\nLook at [How to configure AWS](https://github.com/Aracki/goimage/tree/master/bucket)?\n\n## Deploy\n\nFor deploying lambda function you can use one of the following: \n\n- [Serverless](https://serverless.com)\n- [AWS SAM](https://docs.aws.amazon.com/lambda/latest/dg/serverless_app.html)\n- [AWS CloudFormation](https://aws.amazon.com/cloudformation/)\n- ...\n\nOfficial documentation on how to deploy Lambda apps [Deploying Lambda Apps]( https://docs.aws.amazon.com/lambda/latest/dg/deploying-lambda-apps.html).\n\n#### With Serverless\n\n- `npm install serverless -g` \n- `make build` \n- deploy app with `serverless deploy` or `sls deploy`\n\n## Usage\n\nMake a POST request on API with following params:\n\n| name of parameter | what is it?                                      |\n| ----------------- | :----------------------------------------------- |\n| name              | name of picture from source bucket to be resized |\n| bucketSrc         | name of source bucket                            |\n| bucketDst         | name of destination bucket                       |\n|  subtype\t\t\t     | which type of image transformation is used (look at [Subtypes](#subtypes))\t|\n| lib               | which library is used (look at [Algorithm](#algorithms)) |\n| filter            | which filter/algorithm is used (look at [Algorithm](#algorithms)) |\n| quality           | ranges from 1 to 100 inclusive, higher is better. |\n\nExample of API request:\n\n```\nhttp://[url]/name=under_the_sun.jpg\u0026bucketSrc=source\u0026bucketDst=destination\u0026subtype=resize\u0026alg=imaging\u0026filter=nn\n```\n\nArray of variations needs to be sent as JSON to request body:\n\n```\n{\n    \"dim\": [\n        {\n            \"w\":350,\n            \"h\":300\n        },\n        {\n            \"w\":1200,\n            \"h\":750\n        }\n    ]\n}\n```\n\nIf function is successful, it will return status 200 and list of paths:\n```\n[\n  \"Thumbnails/350x300/under_the_sun.jpg\",\n  \"Thumbnails/1200x750/under_the_sun.jpg\"\n]\n```\n\nIf not, it will return status 4xx, 5xx and message of error:\n\n```\nErrCodeNoSuchKey occurred: NoSuchKey: The specified key does not exist.\nstatus code: 404, request id: 04BC7EA67C9B5407, host id: 4Uz26ywSVspr9BobIF/5yJS9q+8/xq2gP1IpTojZE+wMcecx27ajDhF3EAxXXEqkJs4qa3Quchw=\n```\n\n## Subtypes\n\n| subtype (type of image transformation) | query param value |\n| -------------------------------------- | ----------------- |\n| [resize](#resize)                      | resize            |\n| [smart crop](#smart-crop)              | smart_crop        |\n| [crop](#crop)                          | crop              |\n\nFor all subtypes there are required params: \n\n- name\n- bucketSrc\n- bucketDst\n\nand required body in JSON format:\n\n- dim array\n\n### Resize\n\n#### Algorithms\n\n| library                                                      | query param value |\n| ------------------------------------------------------------ | ----------------- |\n| [disintegration/imaging](https://github.com/disintegration/imaging) | imaging           |\n| [nfnt](https://github.com/nfnt/resize)                       | nfnt              |\n\n| algorithms for disintegration/imaging | query param value |\n| ------------------------------------- | ----------------- |\n| NearestNeighbor                       | nn                |\n| Box                                   | box               |\n| Linear                                | linear            |\n| MitchellNetravali                     | mn                |\n| CatmullRom                            | cr                |\n| Gaussian                              | gaussian          |\n| Lanczos                               | lan               |\n\n| algorithms for nfnt | query param value |\n| ------------------- | ----------------- |\n| NearestNeighbor     | nn                |\n| Bilinear            | bil               |\n| Bicubic             | bic               |\n| MitchellNetravali   | mn                |\n| Lanczos2            | lan2              |\n| Lanczos3            | lan3              |\n\n### Smart Crop \n\nSmartcrop finds good image crops for arbitrary sizes. It is using https://github.com/muesli/smartcrop.\n\n### Crop\n\nCrop resize and crop the image to fill the Width and Height area.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faracki%2Fgoimage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faracki%2Fgoimage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faracki%2Fgoimage/lists"}