zxl
7 天以前 c83101eb62f5d4906b9c01ceea6b21a37f9e84d8
ycl-server/src/main/java/com/ycl/task/ImageCompressTask.java
@@ -171,7 +171,11 @@
            // ====================== 压缩逻辑结束 ======================
            // 写入临时文件并替换原文件
            tempFile = File.createTempFile("compressed_", "." + formatName);
            String tempFileName = "compressed_" + System.currentTimeMillis() + "." + formatName;
            tempFile = new File(localFile.getParentFile(), tempFileName); // 临时文件和原文件同目录
            log.info("临时文件路径:{},原文件路径:{}",
                    tempFile.getAbsolutePath(),
                    localFile.getAbsolutePath());
            try (OutputStream tempOs = new FileOutputStream(tempFile)) {
                byte[] buffer = new byte[1024];
                int len;