Skip to content

a program that listens on rabbitmq message with image updates, loads an URL, scales the images and pushes them to a min.io instance

License

Notifications You must be signed in to change notification settings

synyx/imagescaler

Repository files navigation

Message Driven Image Scaler

The imagescaler is a program that uses Go's builtin image processing capabilities to scale down images stored in an object storage (currently min.io) system.

Motivation

Traditionally image processing is done from within a given program using native bindings to the overly popular ImageMagick (or similar programs). This has drawbacks:

  • Operational complexity: The host or container needs to provide a recent version of the image processing tool. The lifecycle of the tool needs to managed, too.

  • Synchronous calls of potentially expensive operations.

  • ...

Flow

The imagescaler consumes image update message, and reads them from the provided URL. This URL is not required to reside in the configured object storage, BTW. There are 2 different target scales:

  • WEB for usage on web sites
  • THUMBNAIL for icons or thumbnails (also on websites)

The scaled versions are stored (put) to a configured object storage (currently min.io) and new image update events for the scaled versions and their URLs are published.

Message Format

Currently consuming and emitting messages formatted like this:

{
"userUUID": "schnubbli",
"imageUUID": "yolo",
"url": "http://localhost:9000/testbucket/vivian_robin.jpg",
"imageScale": "ORIGINAL"
}

Configuration

tbw.

About

a program that listens on rabbitmq message with image updates, loads an URL, scales the images and pushes them to a min.io instance

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published