导出图片压缩

This commit is contained in:
2025-11-27 11:00:34 +08:00
parent 7753444f25
commit 63a9d2f8f9
2 changed files with 94 additions and 9 deletions

View File

@ -34,9 +34,9 @@ public class IgnoreFailedImageConverter implements Converter<URL> {
// 指数退避初始延迟(毫秒)
private static final int INITIAL_DELAY = 1000;
// 图片压缩阈值(1MB)
private static final int COMPRESSION_THRESHOLD = 1024 * 1024;
// 压缩目标大小(100KB)
private static final int COMPRESSION_TARGET = 100 * 1024;
private static final int COMPRESSION_THRESHOLD = 100 * 1024;
// 压缩目标大小(50KB)
private static final int COMPRESSION_TARGET = 50 * 1024;
// 用于跟踪本次任务中使用到的URL缓存键
private static final ThreadLocal<Set<String>> USED_CACHE_KEYS = new ThreadLocal<Set<String>>() {
@Override
@ -82,6 +82,7 @@ public class IgnoreFailedImageConverter implements Converter<URL> {
/**
* 加载图片数据的核心方法
*
* @param value 图片URL
* @return WriteCellData对象
*/
@ -296,6 +297,7 @@ public class IgnoreFailedImageConverter implements Converter<URL> {
/**
* 预加载图片到缓存
*
* @param imageUrls 图片URL列表
*/
public static void preloadImages(Set<URL> imageUrls) {