修改id生成机制

This commit is contained in:
2026-04-04 14:24:18 +08:00
parent ff1227cde6
commit baefafeff7
3 changed files with 7 additions and 7 deletions

View File

@@ -17,7 +17,7 @@ class Vips {
/// 如果同时指定 [w] 和 [h],图片将按比例缩放以适应指定尺寸
Future<File> generatePreview(String imgPath, {int? w, int? h}) async {
// 生成缓存文件名:包含原图 hash 和尺寸信息
final baseName = basename(imgPath).hashCode.toString();
final baseName = imgPath.hashCode.toString();
final sizeSuffix = _buildSizeSuffix(w, h);
final imgOut = "$cacheDir/preview/$baseName$sizeSuffix.webp";
final outFile = File(imgOut);