Commit fe904703 authored by duanjinfei's avatar duanjinfei

update check base64

parent 1c790eee
......@@ -116,12 +116,18 @@ func IsBase64ImageStr(imageStr string) (bool, []byte, string, string) {
if len(dataSuffix) < 2 {
return false, nil, "", ""
}
log.Info("dataSuffix:", dataSuffix)
formatStrArr := strings.Split(dataSuffix[0], ":")
if len(formatStrArr) < 2 {
return false, nil, "", ""
}
formatStr := formatStrArr[1]
suffix := strings.Split(formatStr, "/")[1]
log.Info("formatStr:", formatStr)
suffixArr := strings.Split(formatStr, "/")
if len(suffixArr) < 2 {
return false, nil, "", ""
}
suffix := suffixArr[1]
return true, decodeBytes, formatStr, suffix
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment