|
@@ -75,20 +75,23 @@ public class PersonDeviceLogServiceImpl implements PersonDeviceLogService {
|
|
|
String retFileUrl = "";
|
|
|
try {
|
|
|
|
|
|
- BASE64Decoder decoder = new BASE64Decoder();
|
|
|
+ if (StringUtils.isNotBlank(faceImageJson.getStr("Data"))){
|
|
|
+ BASE64Decoder decoder = new BASE64Decoder();
|
|
|
|
|
|
- byte[] imgData = decoder.decodeBuffer(faceImageJson.getStr("Data"));
|
|
|
+ byte[] imgData = decoder.decodeBuffer(faceImageJson.getStr("Data"));
|
|
|
|
|
|
- for (int i = 0; i < imgData.length; ++i) {
|
|
|
- if (imgData[i] < 0) {// 调整异常数据
|
|
|
- imgData[i] += 256;
|
|
|
+ for (int i = 0; i < imgData.length; ++i) {
|
|
|
+ if (imgData[i] < 0) {// 调整异常数据
|
|
|
+ imgData[i] += 256;
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
|
|
|
- ByteArrayInputStream inputStream = new ByteArrayInputStream(imgData);
|
|
|
+ ByteArrayInputStream inputStream = new ByteArrayInputStream(imgData);
|
|
|
|
|
|
|
|
|
- retFileUrl = OSSUtil.upload(ossConfig, "/devicePersonLog", faceImageJson.getStr("Name"), inputStream);
|
|
|
+ retFileUrl = OSSUtil.upload(ossConfig, "/devicePersonLog", faceImageJson.getStr("Name"), inputStream);
|
|
|
+ }
|
|
|
+
|
|
|
} catch (Exception e) {
|
|
|
log.error("保存图片路径错误" + e.getMessage());
|
|
|
}
|