wallpapers

package module
v0.0.0-...-207ddee Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2026 License: MIT Imports: 13 Imported by: 0

README

Wallpapers

A site that displays my wallpaper collection. Images are stored in Google Cloud Storage with metadata in SQLite.

Features

  • Masonry grid gallery with search by keyword, color (#ff5500), resolution (1920x1080), or format
  • Automatic image analysis using Gemini (colors, OCR, content tags)

Usage

# Run the server
go run ./cmd/server

# Sync images from Dropbox and analyze new ones
GEMINI_API_KEY=... ./update.sh

Environment Variables

  • GEMINI_API_KEY: Required for image analysis during upload
  • PORT: Server port (default: 8080)

Documentation

Index

Constants

View Source
const (
	Bucket = "iccowalls"
)

Variables

View Source
var (
	NameRegex = regexp.MustCompile("[^a-z0-9]")
)

Functions

func DeleteFile

func DeleteFile(ctx context.Context, filename string) error

func FormatName

func FormatName(in string) string

FormatName formats a filename to match our requirements.

func FullRezURL

func FullRezURL(key string) string

FullRezURL returns the URL a cropped version hosted by imgix.

func GetFileCRC

func GetFileCRC(content []byte) uint32

func GetGoogleCRC

func GetGoogleCRC(ctx context.Context, filename string) (uint32, error)

func RawURL

func RawURL(key string) string

RawURL returns the direct URL to the original file in GCS.

func ThumbURL

func ThumbURL(key string) string

ThumbUrl returns the URL a small cropped version hosted by imgix.

func UploadFile

func UploadFile(ctx context.Context, filename string, content []byte) error

UploadFile takes a file name and content and uploads it to GoogleCloud.

Types

type File

type File struct {
	CRC32C       uint32    `json:"-"`
	Etag         string    `json:"etag"`
	FileURL      string    `json:"-"`
	FullRezURL   string    `json:"cdn"`
	Name         string    `json:"key"`
	Size         int64     `json:"-"`
	ThumbnailURL string    `json:"thumbnail"`
	Created      time.Time `json:"created_at"`
	Updated      time.Time `json:"updated_at"`
}

File is a subset of storage.ObjectAttrs that we need.

func GetAll

func GetAll(ctx context.Context) ([]*File, error)

GetAll returns all of the attributes for files in GCS.

Directories

Path Synopsis
Package analysis provides image analysis functionality including color extraction, resolution detection, and Gemini API integration.
Package analysis provides image analysis functionality including color extraction, resolution detection, and Gemini API integration.
cmd
server command
uploader command
Package db provides SQLite database operations for image metadata.
Package db provides SQLite database operations for image metadata.

Jump to

Keyboard shortcuts

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