Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how assign image path? #16

Open
weidalin opened this issue Nov 11, 2022 · 1 comment
Open

how assign image path? #16

weidalin opened this issue Nov 11, 2022 · 1 comment

Comments

@weidalin
Copy link

return :
400
{"request_id":"2022111111241301021001804606D4E147","time_elapsed":"24.80752ms","code":50207,"message":"Image Decode Error: image format unsupported","data":null}

how edit "
form.Add("image_base64", "")
"

form.Add("image_base64", imgPath)
or
image_base64 = toBase64(imgPath)
form.Add("image_base64", image_base64)?

@weidalin
Copy link
Author

srcByte, err := ioutil.ReadFile(D:\\1.jpg)
if err != nil {
log.Fatal(err)
}

image_base64 := base64.StdEncoding.EncodeToString(srcByte)
form := url.Values{}
form.Add("image_base64", image_base64)

resp, status, err := visual.DefaultInstance.GeneralSegment(form)
fmt.Println(status, err)
b, _ := json.Marshal(resp)

how to write byte[] b to image?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant