{"id":18808558,"url":"https://github.com/lileio/image_service","last_synced_at":"2025-04-13T20:23:01.030Z","repository":{"id":46824040,"uuid":"82229130","full_name":"lileio/image_service","owner":"lileio","description":"An image processing gRPC service, with optional cloud storage","archived":false,"fork":false,"pushed_at":"2017-04-20T18:45:21.000Z","size":274,"stargazers_count":51,"open_issues_count":0,"forks_count":7,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-06-19T05:37:55.042Z","etag":null,"topics":["docker","golang","grpc","image-processing","libvips","lile","service"],"latest_commit_sha":null,"homepage":"","language":"Go","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/lileio.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":"2017-02-16T21:43:12.000Z","updated_at":"2024-06-19T05:37:55.043Z","dependencies_parsed_at":"2022-09-07T06:02:09.755Z","dependency_job_id":null,"html_url":"https://github.com/lileio/image_service","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/lileio%2Fimage_service","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lileio%2Fimage_service/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lileio%2Fimage_service/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lileio%2Fimage_service/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lileio","download_url":"https://codeload.github.com/lileio/image_service/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223602678,"owners_count":17171952,"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","golang","grpc","image-processing","libvips","lile","service"],"created_at":"2024-11-07T23:13:16.095Z","updated_at":"2024-11-07T23:13:16.674Z","avatar_url":"https://github.com/lileio.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ImageService\n[![Build Status](https://travis-ci.org/lileio/image_service.svg?branch=master)](https://travis-ci.org/lileio/image_service)\n\nAn gRPC based parallel image processing and storage microservice. Image Service takes an original image and a set of 'operations' to process and streams the results as they're complete back to the client. Optional no operations can be requested and the original is stored using the storage provided for later use with external services (imgix.com etc).\n\nProcessing is done by a set of 'workers' to limit concurrency and overloading. \n\nBy default 5 workers are run, meaning only 5 image resizing or uploading operations happen concurrently. New operations are queued and streamed back to the client when completed.\n\nA \"sync\" method is there for convenience, it's worth nothing that this method still uploads and processes concurrently but returns all the images at once when they're all complete.\n\nImage processing uses [bimg](https://github.com/h2non/bimg) which is backed by [libvips](http://www.vips.ecs.soton.ac.uk/index.php?title=Libvips).\n\n``` protobuf\nservice ImageService {\n  rpc Store(ImageStoreRequest) returns (stream Image) {}\n  rpc StoreSync(ImageStoreRequest) returns (ImageSyncResponse) {}\n  rpc Delete(DeleteRequest) returns (DeleteResponse) {}\n}\n```\n\n## Docker\n\nA pre build Docker container is available at:\n\n```\ndocker pull lileio/image_service\n```\n\n## Setup\n\nConfiguration of storage is done via ENV variables\n\n### Worker Pool Size\n\nTo increase or decrease the number of parallel workers, set the `WORKER_POOL_SIZE` var.\n\n```\nWORKER_POOL_SIZE=10\n```\n\n### Cloud Storage\n\nTo point to a [cloud storage service](https://github.com/lileio/cloud_storage_service) instance.\n\n```\nCLOUD_STORAGE_ADDR=10.0.0.1:8000\n```\n\n### File Storage\n\nFile system storage is also available, note that you will be responsible for hosting/serving behind something like nginx or a CDN.\n\n```\nFILE_LOCATION=/path/to/webserver\n```\n\n## Example\n\n``` go\n\n// Setup a client connection\nclient = image_service.NewImageServiceClient(conn)\n\n// Create a request object\nb, err := ioutil.ReadFile(\"pic.jpg\")\nif err != nil {\n  panic(err) \n}\n\nctx := context.Background()\nreq := \u0026image_service.ImageStoreRequest{\n  Filename: \"pic.jpg\",\n  Data:     b,\n  Ops: []*image_service.ImageOperation{\n    \u0026image_service.ImageOperation{\n      Crop:        true,\n      Width:       200,\n      Height:      200,\n      VersionName: \"small\",\n    },\n    \u0026image_service.ImageOperation{\n      Crop:        true,\n      Width:       600,\n      Height:      600,\n      VersionName: \"medium\",\n    },\n    \u0026image_service.ImageOperation{\n      Crop:        true,\n      Width:       1000,\n      Height:      1000,\n      VersionName: \"large\",\n    },\n  },\n}\n\n\nstream, err := client.Store(ctx, req)\n\nfor {\n  img, err := stream.Recv()\n  if err == io.EOF {\n    break\n  }\n\n  if err != nil {\n    fmt.Printf(\"err = %+v\\n\", err)\n  }\n\n  fmt.Printf(\"img = %+v\\n\", img.URL)\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flileio%2Fimage_service","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flileio%2Fimage_service","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flileio%2Fimage_service/lists"}