|
@@ -168,10 +168,12 @@ public class CollectApi {
|
|
|
ImageIO.write(bufferedImage, "jpg", new File(thumbFileName));
|
|
|
|
|
|
String md5 = request.getHeader("md5");
|
|
|
- String sliceMD5 = DigestUtils.md5Hex(new FileInputStream(outFile));
|
|
|
+ FileInputStream in = new FileInputStream(outFile);
|
|
|
+ String sliceMD5 = DigestUtils.md5Hex(in);
|
|
|
if(!md5.equalsIgnoreCase(sliceMD5)){
|
|
|
throw new RuntimeException("图片md5值不一致");
|
|
|
}
|
|
|
+ in.close();
|
|
|
// ImageCompression.imageThumbnail(outFile,new File(thumbFileName),compressionConfig);
|
|
|
}
|
|
|
|
|
@@ -208,10 +210,12 @@ public class CollectApi {
|
|
|
File outFile = saveImage(student, inputStream, savePath);
|
|
|
|
|
|
String md5 = request.getHeader("md5");
|
|
|
- String sheetMD5 = DigestUtils.md5Hex(new FileInputStream(outFile));
|
|
|
+ FileInputStream in = new FileInputStream(outFile);
|
|
|
+ String sheetMD5 = DigestUtils.md5Hex(in);
|
|
|
if(!md5.equalsIgnoreCase(sheetMD5)){
|
|
|
throw new RuntimeException("图片md5值不一致");
|
|
|
}
|
|
|
+ in.close();
|
|
|
}
|
|
|
|
|
|
@RequestMapping(value = "subject/collect-config", method = RequestMethod.POST)
|