mirror of
https://github.com/kevin-DL/services.git
synced 2026-01-22 15:25:19 +00:00
Fix image convert (#185)
This commit is contained in:
@@ -268,8 +268,11 @@ func (e *Image) Convert(ctx context.Context, req *img.ConvertRequest, rsp *img.C
|
|||||||
}
|
}
|
||||||
rsp.Url = fmt.Sprintf("%v/%v/%v/%v/%v", e.hostPrefix, "micro", "images", tenantID, req.Name)
|
rsp.Url = fmt.Sprintf("%v/%v/%v/%v/%v", e.hostPrefix, "micro", "images", tenantID, req.Name)
|
||||||
} else {
|
} else {
|
||||||
dst := []byte{}
|
src := buf.Bytes()
|
||||||
base64.StdEncoding.Encode(dst, buf.Bytes())
|
length := base64.StdEncoding.EncodedLen(len(src))
|
||||||
|
dst := make([]byte, length)
|
||||||
|
base64.StdEncoding.Encode(dst, src)
|
||||||
|
|
||||||
rsp.Base64 = string(dst)
|
rsp.Base64 = string(dst)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user