Versions in this module Expand all Collapse all v1 v1.0.0 Nov 9, 2018 Changes in this version + const MinBufSize + var ErrGetFrame = errors.New("failed to get frame") + var ErrNoCoverArt = errors.New("no cover art found") + var ErrNoStreams = errors.New("no decodeable video or audio streams found") + var ErrStreamNotFound = errors.New("no stream of this type found") + var ErrThumbnailingUnknown = errors.New("unknown thumbnailing error") + var ErrTooTall = ErrInvalidImage("image too tall") + var ErrTooWide = ErrInvalidImage("image too wide") + func DetectMIME(r io.Reader, accepted map[string]bool) (string, string, error) + func DetectMIMEBuffer(buf []byte, accepted map[string]bool) (string, string, error) + func GetBuffer() []byte + func GetBufferCap(capacity int) []byte + func Process(rs io.ReadSeeker, opts Options) (src Source, thumb Thumbnail, err error) + func ProcessBuffer(buf []byte, opts Options) (src Source, thumb Thumbnail, err error) + func ReadFrom(r io.Reader) ([]byte, error) + func ReadInto(buf []byte, r io.Reader) ([]byte, error) + func RegisterMatcher(m Matcher) + func RegisterProcessor(mime string, fn Processor) + func ReturnBuffer(buf []byte) + type Dims struct + Height uint + Width uint + type ErrCorruptImage string + func (e ErrCorruptImage) Error() string + type ErrInvalidImage string + func (e ErrInvalidImage) Error() string + type ErrUnsupportedMIME string + func (e ErrUnsupportedMIME) Error() string + type FFContext struct + func NewFFContext(rs io.ReadSeeker) (*FFContext, error) + func (c *FFContext) Close() + func (c *FFContext) CodecName(typ FFMediaType) (string, error) + func (c *FFContext) CoverArt() []byte + func (c *FFContext) Duration() time.Duration + func (c *FFContext) ExtractMeta(src *Source) + func (c *FFContext) HasCoverArt() bool + func (c *FFContext) HasStream(typ FFMediaType) (bool, error) + func (c *FFContext) Thumbnail() (thumb Image, err error) + type FFMediaType int8 + const FFAudio + const FFUnknown + const FFVideo + type Image struct + Data []byte + type Matcher interface + Match func([]byte) (mime string, extension string) + type MatcherFunc func([]byte) (string, string) + func (fn MatcherFunc) Match(data []byte) (string, string) + type Options struct + AcceptedMimeTypes map[string]bool + JPEGQuality uint8 + MaxSourceDims Dims + PNGQuality struct{ ... } + ThumbDims Dims + type Processor func(Source, Options) (Source, Thumbnail, error) + type Source struct + Artist string + Extension string + HasAudio bool + HasVideo bool + Length time.Duration + Mime string + Title string + type Thumbnail struct + IsPNG bool + type UnsupportedMIMEError = ErrUnsupportedMIME Other modules containing this package github.com/bakape/thumbnailer/v2