Versions in this module Expand all Collapse all v0 v0.1.0 Aug 6, 2026 Changes in this version + const KeyMTime + const KeyMimetype + const KeySize + const KeySoftware + const KeyURI + var ErrFailed = errors.New("thumbnail: source previously failed to thumbnail") + func FileURI(path string) string + func Get(uri string) (string, error) + func GetImage(uri string) (image.Image, error) + func Hash(uri string) string + type Cache struct + AppName string + Filter Filter + MaxBytes int64 + Provider Provider + Root string + Size Size + Software string + func New(size Size, opts ...Option) *Cache + func (c *Cache) Get(uri string) (string, error) + func (c *Cache) GetImage(uri string) (image.Image, error) + func (c *Cache) Live(img image.Image) (*image.RGBA, error) + func (c *Cache) Path(uri string) string + type FileProvider struct + MaxBytes int64 + func (p FileProvider) Thumbnail(path string) (image.Image, error) + type Filter int + const Bilinear + const CatmullRom + type FramebufferProvider struct + Img image.Image + func (p FramebufferProvider) Thumbnail(_ string) (image.Image, error) + type Option func(*Cache) + func WithAppName(name string) Option + func WithFilter(f Filter) Option + func WithMaxBytes(n int64) Option + func WithProvider(p Provider) Option + func WithRoot(root string) Option + func WithSoftware(s string) Option + type Provider interface + Thumbnail func(src string) (image.Image, error) + type Size int + const Large + const Normal + const XLarge + const XXLarge + func (s Size) Dir() string + func (s Size) Pixels() int + func (s Size) Valid() bool