Documentation ¶
Index ¶
- Variables
- func DecodeFromBase64(base64 []byte) ([]byte, error)
- func DecodeToImageFile(base64 []byte, dest string, perm os.FileMode) error
- func DecodeWithPath(src string) (image.Image, string, error)
- func EncodeToBase64String(data []byte) (string, error)
- func GetImageBase64(imagePath string) (string, error)
- func GetWebImageBase64(url string) (string, error)
- func ToBmp(src, dest string) error
- func ToJpeg(src, dest string, qualityArgs ...int8) error
- func ToPng(src, dest string) error
- func ToTiff(src, dest string, opts *tiff.Options) error
- type Info
Constants ¶
This section is empty.
Variables ¶
Decode 解码图片
@param r 类型可以是: *os.File(用完记得调用Close())
Functions ¶
func DecodeFromBase64 ¶
DecodeFromBase64 图片的base64数据 => 图片的数据(可以直接存储到硬盘上)
@param base64 带不带前缀都无所谓(e.g. "data:image/png;base64,"、"data:image/jpeg;base64,"、"data:image/gif;base64,")
func DecodeWithPath ¶
DecodeWithPath 解码图片
func EncodeToBase64String ¶
func GetImageBase64 ¶
GetImageBase64 (硬盘上的)图片 => base64字符串
参考: golang 将图片生成Base64 https://blog.csdn.net/weixin_40292098/article/details/126029489
func GetWebImageBase64 ¶
GetWebImageBase64 网络图片 => base64字符串
参考: golang 将图片生成Base64 https://blog.csdn.net/weixin_40292098/article/details/126029489
@param url e.g."https://img.redocn.com/sheying/20150507/pugongying_4267498.jpg"
Types ¶
Click to show internal directories.
Click to hide internal directories.