By: Michael Lynch <git@mtlynch.io>
Add unit tests for importers/images.go and importers/media.go Refactor GenerateAndWriteSquareThumbnail, GenerateAndWriteResized, and ImportMedia to accept io.Writer instead of (mediaDir, destFilename string), so tests can pass a bytes.Buffer without touching the filesystem. The GIF-to-AVIF path in ImportMedia still requires a real file path for ffmpeg, so convertGIFToAnimatedAVIF now writes to a temp file then copies the result into the provided writer. Update the single caller (cmd/import-from-tinybeans/main.go) with a createAndWrite helper that creates the destination file and passes it as the writer. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>