Documentation ¶
Index ¶
Constants ¶
const ( ProcessIdentificationAliCloud = "?x-oss-process=image/info" ProcessIdentificationQiNiu = "?imageMogr2" ProcessIdentificationByteDance = "~tplv-" )
各服务商图片处理标识
const ( BasicInfoSuffixAliCloud = "?x-oss-process=image/info" BasicInfoSuffixQiNiu = "?imageInfo" BasicInfoSuffixByteDance = "~info" )
Variables ¶
This section is empty.
Functions ¶
func GetOssOriginalUrl ¶
GetOssOriginalUrl 获取 OSS 图片未做处理链接
func GetOssOriginalUrlWithIdf ¶
GetOssOriginalUrlWithIdf 通过 ProcessIdentification 获取 OSS 图片未做处理链接
Types ¶
type AliOssImageInfo ¶
type AliOssImageInfo struct { FileSize struct { Value string `json:"value"` } `json:"FileSize"` Format struct { Value string `json:"value"` } `json:"Format"` ImageHeight struct { Value string `json:"value"` } `json:"ImageHeight"` ImageWidth struct { Value string `json:"value"` } `json:"ImageWidth"` }
AliOssImageInfo 阿里云图片基本信息 Example: http://image-demo.oss-cn-hangzhou.aliyuncs.com/example.jpg?x-oss-process=image/info
type ImageInfo ¶
type ImageInfo struct { Width int `json:"width"` Height int `json:"height"` Format string `json:"format"` Size int `json:"size"` }
ImageInfo 公共图片信息(七牛云/字节可通用) Example: 七牛 http://dn-odum9helk.qbox.me/resource/gogopher.jpg?imageInfo Example: 字节 http://p3-imagex.byteimg.com/imagex-rc/preview.jpg~info
func ParseAliOssImageInfo ¶
ParseAliOssImageInfo 解析阿里云图片基本信息 imgUrl 需为去除 OSS 图片处理参数后的链接,可参考 GetOssOriginalUrl 去除 ApiDoc: https://help.aliyun.com/document_detail/44975.html
func ParseByteDanceImageInfo ¶
ParseByteDanceImageInfo 解析七牛云/字节图片基本信息 imgUrl 需为去除 OSS 图片处理参数后的链接,可参考 GetOssOriginalUrl 去除 ApiDoc: 字节 https://www.volcengine.com/docs/508/64085
func ParseOssImageInfo ¶
ParseOssImageInfo 解析OSS服务商图片信息 PS: 适用无图片处理后缀场景
func ParseQiNiuImageInfo ¶
ParseQiNiuImageInfo 解析七牛云图片基本信息 imgUrl 需为去除 OSS 图片处理参数后的链接,可参考 GetOssOriginalUrl 去除 ApiDoc: 七牛云 https://developer.qiniu.com/dora/1269/pictures-basic-information-imageinfo