thumb

package
v0.0.0-...-746aa3e Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2020 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Thumb

type Thumb struct {
	// contains filtered or unexported fields
}

Thumb 缩略图

func NewThumbFromFile

func NewThumbFromFile(file io.Reader, name string) (*Thumb, error)

NewThumbFromFile 从文件数据获取新的Thumb对象, 尝试通过文件名name解码图像

func (*Thumb) CreateAvatar

func (image *Thumb) CreateAvatar(uid uint) error

CreateAvatar 创建头像

func (*Thumb) GetSize

func (image *Thumb) GetSize() (int, int)

GetSize 获取图像尺寸

func (*Thumb) GetThumb

func (image *Thumb) GetThumb(width, height uint)

GetThumb 生成给定最大尺寸的缩略图

func (*Thumb) Save

func (image *Thumb) Save(path string) (err error)

Save 保存图像到给定路径

Jump to

Keyboard shortcuts

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