avatar

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Avatar

type Avatar struct {
	Width     uint
	Height    uint
	MaxWidth  int
	MaxHeight int
}

Avatar 头像参数

func (Avatar) Prepare

func (sf Avatar) Prepare(data []byte) (image.Image, error)

Prepare accepts a byte slice as input, validates it contains an image of an acceptable format, and crops and resizes it appropriately.

func (*Avatar) RandomImage

func (sf *Avatar) RandomImage(data []byte) (image.Image, error)

RandomImage generates and returns a random avatar image unique to input data in default size (Min(height,width) height and width).

Jump to

Keyboard shortcuts

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