feat(lagoon): WebP variants of attachment thumbnails
- attach.VariantKey: a thumbnail's copy in another format next to it - attach/webp (separate package, so only binaries that import it link the encoder): Encode at quality 80 and Variant, which writes the WebP copy of a thumbnail once and leaves no file on a failed encode - github.com/gen2brain/webp v0.6.4, decided in .planning/notes/2026-10-28-webp-gen2brain.md - lagoon README and docs/database/attachments.md
This commit is contained in:
13
modules/lagoon/attach/webp/export_test.go
Normal file
13
modules/lagoon/attach/webp/export_test.go
Normal file
@@ -0,0 +1,13 @@
|
||||
package webp
|
||||
|
||||
import (
|
||||
"image"
|
||||
"io"
|
||||
)
|
||||
|
||||
// SetEncoderForTest replaces the encoder Variant uses and returns the
|
||||
// restore function (tests only).
|
||||
func SetEncoderForTest(fn func(io.Writer, image.Image) error) func() {
|
||||
encodeImage = fn
|
||||
return func() { encodeImage = Encode }
|
||||
}
|
||||
Reference in New Issue
Block a user