yeeImage

package
v0.0.0-...-89bd919 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2020 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetImageInfo

func GetImageInfo(inputFilePath string) (int, int, error)

GetImageInfo 获取图片的宽高信息

func LoadImage

func LoadImage(inputImagePath string) (img image.Image, err error)

LoadImage 从文件中解码出image

func ProcessImage

func ProcessImage(inputImagePath, outputImagePath string, processConfig ImageProcessor) error

ProcessImage 图片裁剪

func ResizeImage

func ResizeImage(inputImagePath, outputImagePath string, width, height uint) error

ResizeImage 图片缩放

func SaveImage

func SaveImage(outputImagePath string, img image.Image) (err error)

SaveImage 将image保存到文件中,根据后缀判断保存形式,如果后缀不匹配,则png

func ThumbImage

func ThumbImage(inputImagePath, outputImagePath string, maxWidth, maxHeight uint) error

ThumbImage 生成缩略图,根据传入的最大宽高生成缩略图,不会改变图片的比例

Types

type ImageProcessor

type ImageProcessor struct {
	//距离左边距离
	LeftPoint int
	//距离上边距离
	TopPoint int
	//裁剪后的宽
	Width int
	//剪裁后的高
	Height int
}

ImageProcessor 图片剪裁参数

Jump to

Keyboard shortcuts

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