thumbnailer

package
Version: v0.0.0-...-d98ca20 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2019 License: GPL-3.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MaxImageHeight int
View Source
var MaxImageWidth int

Functions

func Startup

func Startup()

Types

type AnimMode

type AnimMode int
const (
	AnimModeGuess AnimMode = iota
	AnimModeNormal
	AnimModeVideo
	AnimModeAudio
)

func ReadFFmpeg

func ReadFFmpeg(body *thumblink.Peekable, animMode AnimMode, mime string, maxWidth, maxHeight int) (ffmpeg.Frame, int, AnimMode, error)

func ReadJPEG

func ReadJPEG(body *thumblink.Peekable, animMode AnimMode, mime string, maxWidth, maxHeight int) (ffmpeg.Frame, int, AnimMode, error)

type Base64Data

type Base64Data struct {
	Header string
	Data   []byte
}

Base64Data represents a data URI in base64 format

func (*Base64Data) HTML

func (b *Base64Data) HTML() []string

HTML impl HTMLAble

func (*Base64Data) Len

func (b *Base64Data) Len() int

Len impl HTMLAble

type Image

type Image struct {
	//URL to show to user
	URL string
	//Actual url to download
	ImageURL string
	//Show a 'animated' icon
	Animated AnimMode
	//Bitfield of ImageFlag*
	Flags ImageFlags
	//Override the server's mime type
	MIMEOverride string
	// Max(Width|Height) = thumbnailer.Mutator.Max(Width|Height)/MaxSize
	MaxSize float64
}

Pass this HTMLAble image down for more control inlining

func (Image) HTML

func (b Image) HTML() []string

func (Image) Len

func (b Image) Len() int

Len impl HTMLAble

type ImageFlags

type ImageFlags uint8
const (
	//Do not report a error if failure occures
	ImageFlagHideError ImageFlags = 1 << iota
	//Do not wrap with <img> tags
	ImageFlagSkipImg
	//Do not wrap with <a> tags
	ImageFlagSkipLink
	//Do not output anything on failure
	//If skipImg is set it will output a 1px x 1px transparent png
	ImageFlagSilent
)

type Mutator

type Mutator struct {
}

Mutator implements thumblink.Mutator.

func (Mutator) Help

func (_ Mutator) Help() string

func (Mutator) Mutate

func (m Mutator) Mutate(in []thumblink.HTMLAble) (out []thumblink.HTMLAble, errors []error)

Mutate impl thumblink.Mutator

Jump to

Keyboard shortcuts

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