(data []byte, filename, contentType string)
| 967 | } |
| 968 | |
| 969 | func imageEditReadJSONImage(data []byte, filename, contentType string) (editImageInput, error) { |
| 970 | if len(data) == 0 { |
| 971 | return editImageInput{}, fmt.Errorf("image data is empty") |
| 972 | } |
| 973 | if filename == "" { |
| 974 | filename = "image.png" |
| 975 | } |
| 976 | if contentType == "" { |
| 977 | contentType = "image/png" |
| 978 | } |
| 979 | return editImageInput{Data: data, Filename: filename, ContentType: contentType}, nil |
| 980 | } |
| 981 | |
| 982 | // imageEditDecodeDataURL 解析 data:image/...;base64,XXXX 形式的 URL。 |
| 983 | func imageEditDecodeDataURL(url string) (editImageInput, error) { |
no outgoing calls
no test coverage detected