Documentation
¶
Overview ¶
Package image 提供 QQ 官方富媒体所需的基础图片格式适配。
只处理 QQ 官方明确支持的图片格式:png / jpg / gif。 非支持格式会尽量转成 png(bmp 转 jpg),不依赖外部 ffmpeg。
Index ¶
Constants ¶
View Source
const ( // MaxImageBytes 单张图片最大输入大小,默认 50 MiB。 MaxImageBytes = 50 << 20 // MaxImageDimension 单边最大像素,防止解压炸弹。 MaxImageDimension = 10000 )
Variables ¶
This section is empty.
Functions ¶
func CheckImage ¶
func CheckImage(r io.ReadSeeker) (string, bool)
CheckImage 通过 content-type 判断数据是否像图片。
func EncodeImage ¶
EncodeImage 把非 png/jpg/gif 的图片转成 QQ 官方支持的格式。 已经是 png/jpg/gif 的数据会原样返回。
func IsGIFOrPNGOrJPG ¶
IsGIFOrPNGOrJPG 判断数据是否已经是 QQ 官方支持的图片格式。
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.