utils

package
v0.0.0-...-d2760a9 Latest Latest
Warning

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

Go to latest
Published: May 4, 2018 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetRandomString

func GetRandomString(strLen int) string

生成随机字符串

func Md5Encode

func Md5Encode(str string) string

md5加密

func StringToPath

func StringToPath(str string, n int) string

字符串分割生成目录

Types

type Imager

type Imager struct {
}

func NewImager

func NewImager() *Imager

func (*Imager) Decode

func (imager *Imager) Decode(imagePath string) (img image.Image, fileType string, err error)

对图片解码

func (*Imager) SaveImage

func (imager *Imager) SaveImage(savePath string, img *image.RGBA, fileType string) (err error)

保存一个 image 对象为文件

func (*Imager) Scaling

func (imager *Imager) Scaling(sourceImage string, saveImage string, width int, height int) (err error)

按宽度和高度进行比例缩放

Jump to

Keyboard shortcuts

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