thumb

package
v0.6.19 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2024 License: AGPL-3.0 Imports: 2 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultSize = Size{
	Width:   200,
	Height:  200,
	Quality: 100,
}

DefaultSize 缩略图默认尺寸

View Source
var Registry = Registries{
	`*`: {DefaultSize},
}

Functions

This section is empty.

Types

type Registries

type Registries map[string]Sizes

func (*Registries) Add

func (r *Registries) Add(subdir string, vs ...Size) *Registries

func (*Registries) Get

func (r *Registries) Get(subdir string) Sizes

func (*Registries) Set

func (r *Registries) Set(subdir string, vs ...Size) *Registries

type Size

type Size struct {
	AutoCrop bool
	Width    float64
	Height   float64
	Quality  int
}

Size 缩略图尺寸信息

func (Size) String

func (t Size) String() string

func (Size) Suffix

func (t Size) Suffix() string

Suffix 文件名称尺寸后缀

func (Size) ThumbValue

func (t Size) ThumbValue() fileupdater.ValueFunc

type Sizes

type Sizes []Size

Sizes 尺寸列表

func AsSizes

func AsSizes(ts ...Size) Sizes

func (*Sizes) Add

func (s *Sizes) Add(size Size)

func (Sizes) AutoCrop

func (s Sizes) AutoCrop() Sizes

func (Sizes) Get

func (s Sizes) Get(width, height float64) *Size

func (Sizes) Has

func (s Sizes) Has(width, height float64) bool

func (Sizes) String

func (s Sizes) String() string

Jump to

Keyboard shortcuts

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