thumbnailer

command module
v0.0.0-...-4feea46 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 15, 2024 License: MIT Imports: 24 Imported by: 0

README

thumbnailer

main

Overview

An app that walks through a directory and creates sprite thumbnails for every directory with images in it. It also creates a .thumbs.yml in the directory with the image paths and their dimensions, that can be used by other apps to display the thumbnails.

Techincal overview

The app is written in Go and uses the following libraries:

If directory contains files with different extensions (.jpg and .png), then different thumbnails are created for each extension. .jpeg and jpg are treated as the same extension.

A signle thumbnails_* file may contain up to 500 images. If there are more images in the directory, then multiple thumbnails_* files are created.

Related repositories:

  • media - all images, thumbnails and .thumbs.yml files
  • finder - a static site generator
  • info - all YML files describing different things
flowchart TB
    R[(R2 storage)]
    M[(media directory)]
    I[(info directory)]
    O[(output directory)]
    C[(CloudFlare Pages)]
    
    M --thumbnailer creates\nthumbnails_* and\n.thumb.yml files--> M
    M --thumbnailer uploads files--> R

    M --finder reads .thumb.yml files --> O
    I --finder reads .yml files --> O
    O --GHA deployes--> C

    I -.has the same directory structure as.-> M
    C -.references.-> R

Usage

Local
export INPUT_MEDIA=/Users/username/Projects/alsosee/media
export INPUT_R2_ACCOUNT_ID=...
export INPUT_R2_ACCESS_KEY_ID=...
export INPUT_R2_ACCESS_KEY_SECRET=...
export INPUT_R2_BUCKET=media

make run

Documentation

Overview

A go app to handle media, thumbnails, blurhashes, etc. It will - generate thumbnails for all images in the directories - upload media and thumbnails to R2 Cloudflare storage if they don't exist yet - generate BlurHash for each photo - keep track of them in a .thumbs.yaml file that will be used by the `finder` to generate the website

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL