更新数据目录配置
This commit is contained in:
@@ -4,8 +4,9 @@ import 'package:path/path.dart';
|
||||
|
||||
class Vips {
|
||||
String? vipsExecuteFile;
|
||||
final String cacheDir;
|
||||
|
||||
Vips({this.vipsExecuteFile});
|
||||
Vips({this.vipsExecuteFile, required this.cacheDir});
|
||||
|
||||
/// 生成图片预览(WebP 格式)
|
||||
///
|
||||
@@ -22,7 +23,7 @@ class Vips {
|
||||
// 生成缓存文件名:包含原图 hash 和尺寸信息
|
||||
final baseName = basename(imgPath).hashCode.toString();
|
||||
final sizeSuffix = _buildSizeSuffix(w, h);
|
||||
final imgOut = "cache/preview/${baseName}${sizeSuffix}.webp";
|
||||
final imgOut = "$cacheDir/preview/$baseName$sizeSuffix.webp";
|
||||
final outFile = File(imgOut);
|
||||
|
||||
// 缓存命中:直接返回已存在的预览图
|
||||
|
||||
Reference in New Issue
Block a user