imageKit

package
v1.3.10 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertImageType

func ConvertImageType(src, dest string) error

ConvertImageType 图片格式转换(图片类型转换)

@param src 源图片路径(如果文件不存在,会报error) @param dest 目标图片路径(如果文件已存在,会覆盖,覆盖不了就报error)

PS: (1) src和dest的图片格式可以是一样的,此种情况类似于复制; (2) 支持的图片格式:"jpg"、"jpeg"、"png"、"gif"、"tif"、"tiff"、"bmp".(详见 imaging.Save())

func DecodeFromBase64

func DecodeFromBase64(base64 []byte) ([]byte, error)

DecodeFromBase64 图片的base64数据 => 图片的数据(可以直接存储到硬盘上)

@param base64 带不带前缀都无所谓(e.g. "data:image/png;base64,"、"data:image/jpeg;base64,"、"data:image/gif;base64,")

func DecodeToImageFile

func DecodeToImageFile(base64 []byte, dest string) error

DecodeToImageFile

@param target 要生成的图片的路径

func EncodeToBase64String

func EncodeToBase64String(data []byte) (string, error)

func GetBase64OfImage

func GetBase64OfImage(imagePath string) (string, error)

GetBase64OfImage (硬盘上的)图片 => base64字符串

参考: golang 将图片生成Base64 https://blog.csdn.net/weixin_40292098/article/details/126029489

func GetBase64OfWebImage

func GetBase64OfWebImage(url string) (string, error)

GetBase64OfWebImage 网络图片 => 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

This section is empty.

Jump to

Keyboard shortcuts

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