img

package
v0.21.4 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

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.

Jump to

Keyboard shortcuts

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