feat(core): 添加PSD/PSB图片格式支持并重构媒体文件处理

- 新增ReadPsdImage函数支持PSD/PSB格式图片信息读取
- 修改文件扫描逻辑,将视频处理改为媒体候选处理,使用ffprobe统一判定
- 添加对PSB格式的支持,与PSD共享相同8BPS文件头处理
- 重构handle_image.go中的图片处理逻辑,优化错误处理和记录保存
- 更新文件扫描过滤规则,支持更多图片格式并跳过数据库文件
- 添加文件MD5计算功能用于文件唯一性标识
- 修改媒体处理流程,支持音频文件识别和分类处理
- 移除废弃的视频时长转换函数和相关依赖
- 更新依赖版本并添加SQLite支持用于媒体信息存储
This commit is contained in:
2025-03-18 21:04:15 +08:00
parent f5e3f6b4ef
commit b276e8c56f
16 changed files with 770 additions and 311 deletions
+2 -1
View File
@@ -4,6 +4,7 @@ var GlobalFilePathList []string // 所有文件的路
var GlobalFilePath2MimeInfoMap = make(map[string]string) // 文件路径和mime信息的映射关系
var GlobalFilePath2FileNameMap = make(map[string]string) // 文件路径和文件名称的映射关系
var GlobalFilePath2FileExtMap = make(map[string]string) // 文件路径和文件扩展名的映射关系
var GlobalVideoPathList []string // 所有视频文件的路径
var GlobalImagePathList []string // 所有图片文件的路径
var GlobalMediaPathList []string // 待ffprobe确认的媒体候选文件
var GlobalAudioPathList []string // 已确认的音频文件路径
var GlobalPickerDir string // 已整理文件的输出目录(白名单,扫描时跳过)
+3 -5
View File
@@ -6,11 +6,9 @@ import (
//go:embed ffprobe.exe
var VideoDecodeToolWin64 []byte
var VideoIgnorePathList []string // 忽略的文件路径
var VideoReadErrorPathList []string // 读取信息异常的路径
var VideoPath2WidthHeightMap = make(map[string]string) // 视频路径和宽高比
var VideoPath2WidthHeightTagMap = make(map[string]string) // 视频路径和宽高比[640x480]
var VideoPath2DurationMap = make(map[string]string) // 视频路径和时长
var VideoIgnorePathList []string // 忽略的文件路径
var VideoReadErrorPathList []string // 读取信息异常的路径
var VideoPath2WidthHeightMap = make(map[string]string) // 视频路径和宽高比
var VideoHorizontalNormalList []string
var VideoHorizontalGifList []string
var VideoHorizontal1KList []string