mirror of
https://gitee.com/open-visual/face-search.git
synced 2025-07-25 19:41:42 +08:00
update:若图片的base64有头信息,手动进行截取
This commit is contained in:
parent
cb0e1e8bf1
commit
1d94f4a7d9
@ -66,9 +66,9 @@ public class ImageMat implements Serializable {
|
||||
public static ImageMat fromBase64(String base64Str){
|
||||
InputStream inputStream = null;
|
||||
try {
|
||||
// 新版本JDK被移除,替换为Base64.Decoder
|
||||
// BASE64Decoder decoder = new BASE64Decoder();
|
||||
// byte[] data = decoder.decodeBuffer(base64Str);
|
||||
if(base64Str.contains(",")){
|
||||
base64Str = base64Str.substring(base64Str.indexOf(",")+1);
|
||||
}
|
||||
Base64.Decoder decoder = Base64.getMimeDecoder();
|
||||
byte[] data = decoder.decode(base64Str);
|
||||
inputStream = new ByteArrayInputStream(data);
|
||||
|
Loading…
x
Reference in New Issue
Block a user