a simple web server serving (scaled) images and color palettes for slideshow.
Go to file
2023-11-30 14:36:49 +01:00
.vscode moved scaling of images from a fixed value to a query parameter 2023-11-29 16:27:23 +01:00
internal updated dependency and formatted code 2023-11-30 14:36:49 +01:00
.gitignore initial commit 2023-11-28 15:52:53 +01:00
go.mod updated dependency and formatted code 2023-11-30 14:36:49 +01:00
go.sum changed type of 'response.Content' from interface{] to string 2023-11-30 14:16:39 +01:00
LICENSE.md initial commit 2023-11-28 15:52:53 +01:00
main.go fixed module name 2023-11-28 16:34:10 +01:00
README.md removed environment variables for the amount of colors and the algorithm for the generation of the color palette in favor of query parameters 2023-11-29 16:43:30 +01:00
slideshow-api.service removed environment variables for the amount of colors and the algorithm for the generation of the color palette in favor of query parameters 2023-11-29 16:43:30 +01:00

slideshow-api

a simple web server serving (scaled) images and color palettes for slideshow.

requirements

endpoints

  • /: request the name of a random image
  • /image/<name-of-an-image.jpeg>[?resolution=1920x1080]: request the named image (in the specified resolution)
  • /palette/<name-of-an-image.jpeg>[?colors=16&algorithm=wsm]: request the color palette of the named image (with the specified amount of colors and algorithm)

configuration

configuration is entirely done via environment variables.

variable default description
SLIDESHOW_ADDRESS "0.0.0.0" the listen address of the web server
SLIDESHOW_PORT 3000 the port of the web server
SLIDESHOW_DIRECTORY "$HOME" path to a directory containing images
SLIDESHOW_SCANINTERVAL 60 the interval for directory scans in seconds
SLIDESHOW_LOGLEVEL "info" the log level

note:
if imagemagick's convert command is not in your $PATH the images will not be scaled.

available log levels:

  • debug
  • info
  • warning
  • error
  • fatal

color palette

available algorithms:

  • wsm
  • wu

for more information regarding the color palette see color-thief.