1 Star 0 Fork 0

Albert Lee / mergi

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
resize.go 487 Bytes
一键复制 编辑 原始数据 按行查看 历史
Noel Yahan 提交于 2018-09-24 09:15 . :tada:the beginning
package mergi
import (
"errors"
"github.com/nfnt/resize"
"image"
)
// Resize uses go standard image.Image, unsigned int for width and height that want to resize
// returns the resize image output
//
// for more resize examples https://github.com/noelyahan/mergi/examples/resize
func Resize(img image.Image, w, h uint) (image.Image, error) {
if img == nil {
return nil, errors.New("Mergi found a error image on Resize")
}
return resize.Resize(w, h, img, resize.Lanczos3), nil
}
Go
1
https://gitee.com/albertlee/mergi.git
git@gitee.com:albertlee/mergi.git
albertlee
mergi
mergi
df743a5b4419

搜索帮助