소스 검색

feat: 修改图片命名

WANGKANG 8 달 전
부모
커밋
fddf317df7
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      taais-modules/taais-biz/src/main/java/com/taais/biz/utils/VideoCapture.java

+ 1 - 1
taais-modules/taais-biz/src/main/java/com/taais/biz/utils/VideoCapture.java

@@ -118,7 +118,7 @@ public class VideoCapture {
 
 
     public static boolean saveImage(Frame frame, String savePath, int idx) {
     public static boolean saveImage(Frame frame, String savePath, int idx) {
         try {
         try {
-            Path outPath = Paths.get(savePath, System.currentTimeMillis() + "_" + idx + ".jpg");
+            Path outPath =  Paths.get(savePath, String.format("%05d", idx) + "_" + System.currentTimeMillis() + ".jpg");
             // System.out.println("图片已保存:" + outPath);
             // System.out.println("图片已保存:" + outPath);
             File outPut = new File(outPath.toString());
             File outPut = new File(outPath.toString());
             ImageIO.write(frameToBufferedImage(frame), "jpg", outPut);
             ImageIO.write(frameToBufferedImage(frame), "jpg", outPut);