{"id":38149829,"url":"https://github.com/youkoulayley/worker_images","last_synced_at":"2026-01-16T23:00:50.744Z","repository":{"id":43249440,"uuid":"160108318","full_name":"youkoulayley/worker_images","owner":"youkoulayley","description":"Resize and crop images in your application asynchronously with NATS.","archived":false,"fork":false,"pushed_at":"2022-11-22T03:45:51.000Z","size":163,"stargazers_count":1,"open_issues_count":3,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2023-03-10T04:42:19.547Z","etag":null,"topics":["crop","crop-image","image","image-processing","nats","nats-streaming","python","resize","resize-images","worker-images"],"latest_commit_sha":null,"homepage":"","language":"Python","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/youkoulayley.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":null,"code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-12-02T23:55:19.000Z","updated_at":"2023-02-08T14:18:30.000Z","dependencies_parsed_at":"2023-01-23T02:45:53.391Z","dependency_job_id":null,"html_url":"https://github.com/youkoulayley/worker_images","commit_stats":null,"previous_names":[],"tags_count":null,"template":null,"template_full_name":null,"purl":"pkg:github/youkoulayley/worker_images","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/youkoulayley%2Fworker_images","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/youkoulayley%2Fworker_images/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/youkoulayley%2Fworker_images/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/youkoulayley%2Fworker_images/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/youkoulayley","download_url":"https://codeload.github.com/youkoulayley/worker_images/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/youkoulayley%2Fworker_images/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28487078,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T22:54:02.790Z","status":"ssl_error","status_checked_at":"2026-01-16T22:50:10.344Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["crop","crop-image","image","image-processing","nats","nats-streaming","python","resize","resize-images","worker-images"],"created_at":"2026-01-16T23:00:27.136Z","updated_at":"2026-01-16T23:00:50.654Z","avatar_url":"https://github.com/youkoulayley.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# worker_images\n[![Build Status](https://travis-ci.org/Youkoulayley/worker_images.svg?branch=master)](https://travis-ci.org/Youkoulayley/worker_images)\n[![Coverage Status](https://coveralls.io/repos/github/Youkoulayley/worker_images/badge.svg?branch=master)](https://coveralls.io/github/Youkoulayley/worker_images?branch=master)\n\nThis project aims to manage the images of the Série-All website. But the project has been thinking with idea \nof being adapted to any other usages.\nThe worker images takes message from NATS, download the desired image, resize it and crop if necessary.\n\n**Workflow of the worker** :\n\n![Worflow](worflow/workflow.jpg)\n\n## NATS\nA NATS streaming server is mandatory for the functioning of the worker_images.\nThe message send to the worker image need to have this format : \n\n```json\n{\n  \"url\": \"https://www.thetvdb.com/banners/fanart/original/5b0fcf2c5c1b5.jpg\", \n  \"name\": \"supergirl\", \n  \"crop_type\": \"poster\", \n  \"crop\": \"middle\",\n  \"force_crop\": \"false\"\n}\n```\n\nThe message contains different section :\n\n* **URL**: The URL where to download the image ;\n* **Name**: The name of the image when saved to the disk ;\n* **Crop_type**: The type to use (show config.ini for more informations) ;\n* **Crop**: The alignment of the crop ;\n* **Force_crop**: If true, force the resize \u0026 crop, even if the fil exists.\n\n## Arguments\nYou can pass a config file in parameter to launch the application :\n```\nusage: worker_images [-h] -c CONFIG_FILE\n\nWorker images resize \u0026 crop image.\n\noptional arguments:\n  -h, --help            show this help message and exit\n  -c CONFIG_FILE, --config-file CONFIG_FILE\n                        Provide config file for the application\n```\n\n## config.ini\nExample : \n\n```\n[DEFAULT]\nimages_folder = ../images\noriginal_folder = %(images_folder)s/original\nimage_formats = {\n    \"poster\": [\n        \"200_200\",\n        \"300_300\",\n        \"500_150\"\n        ],\n    \"banner\": [\n        \"100_50\"\n    ]}\n\n[LOGGING]\nlevel = debug\n\n[NATS]\nservers = [\"nats://127.0.0.1:4222\"]\ntls = no\nca_cert = /etc/ssl/nats/ca.pem\nclient_cert = /etc/ssl/nats/client_cert.pem\nclient_key = /etc/ssl/nats/client_cert.key\ncluster_id = serieall\nconnection_name = worker_images\nchannel = worker_images\n```\n\nThe Default section contains the configuration for the application.\n\n|Name|Description|Type|\n|----|-----------|----|\n|images_folder|Path of images folder|path|\n|original_folder|Path of originals images|path|\n|image_formats|A list of format to crop divided by type. Each type can have a different set of formats. You have to precise the type in the message sent to NATS|list|\n\nThe Logging section contains the configuration for the logger.\n\n|Name|Description|Type|\n|----|-----------|----|\n|level|Log Level|debug/info/warning/error|\n\nThe NATS section contains the configuration to connect to NATS\n\n|Name|Description|Type|\n|----|-----------|----|\n|servers|List of NATS server to connect to|list|\n|tls|Is the connection to NATS server needs TLS ?|yes/no|\n|ca_cert|The CA cert to connect to NATS server|string|\n|client_cert|The client cert to connect to NATS server|string|\n|client_key|The client key to connect to NATS server|string|\n|cluster_id|The cluster of the NATS server|string|\n|connection_name|The name of the application, used for the connection to NATS|string|\n|channel|Channel where the NATS messages are send|string|\n\n## Development\nBefore starting to contribute to this project, you need to setup a NATS Streaming Server. A docker-compose file is present at the root of the repo for this purpose.\nJust launch it : \n```bash\ndocker-compose up -d\n``` \n\nYo can test sending a message to NATS with the bin/nats_pub.py script.\n\n## Tests\nThe project has unit tests and you need to pass all of them before your PR is validated.\nJust run :\n```bash \nmake unittests\n```\n\n## Contributing\n\nThanks for thinking about contributing to worker_images! The success of an open source project is entirely down to the efforts of its contributors, so thank you for even thinking of contributing.\n\nBefore you do so, you should check out our contributing guidelines in the [CONTRIBUTING.md](CONTRIBUTING.md) file, to make sure it's as easy as possible for us to accept your contribution.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyoukoulayley%2Fworker_images","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyoukoulayley%2Fworker_images","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyoukoulayley%2Fworker_images/lists"}