Documentation ¶ Index ¶ func ImgBlur(srcFile string, distFile string, sigma float64) error func ImgBmpToJpg(buf []byte, o *jpeg.Options) []byte func ImgCompress(buf []byte, maxWidth uint, maxHeight uint, o *jpeg.Options) []byte func ImgResize(srcFile string, distFile string, maxWidth uint, maxHeight uint, ...) Constants ¶ This section is empty. Variables ¶ This section is empty. Functions ¶ func ImgBlur ¶ func ImgBlur(srcFile string, distFile string, sigma float64) error 高斯模糊处理 srcFile:处理前文件 distFile:处理后文件 sigma:模糊比例(通常可设定为5) func ImgBmpToJpg ¶ func ImgBmpToJpg(buf []byte, o *jpeg.Options) []byte bmp文件转jpg文件 func ImgCompress ¶ func ImgCompress(buf []byte, maxWidth uint, maxHeight uint, o *jpeg.Options) []byte 图片有损压缩 maxWidth:压缩后的最大宽度 maxHeight:压缩后的最大高度 o:压缩比例(nil时为默认80%) func ImgResize ¶ func ImgResize(srcFile string, distFile string, maxWidth uint, maxHeight uint, o *jpeg.Options) 图片有损压缩(压缩失败时原样保存至目标文件) srcFile:压缩前文件 distFile:压缩后文件 maxWidth:压缩后的最大宽度 maxHeight:压缩后的最大高度 o:压缩比例(nil时为默认80%) Types ¶ This section is empty. Source Files ¶ View all Source files img_blur.go img_bmp_to_jpg.go img_compress.go Click to show internal directories. Click to hide internal directories.