fix: 修复缩略图显示权限问题,使用base64数据URL

解决asset.localhost访问权限问题:
- 添加read_thumbnail_as_data_url命令读取文件并转换为base64数据URL
- 避免使用convertFileSrc的asset.localhost协议访问问题
- 添加base64依赖支持文件编码

 优化缩略图加载:
- 使用数据URL直接在img标签中显示缩略图
- 正确处理Windows长路径前缀 \\\\?\\
- 统一错误处理和降级机制

 技术改进:
- 移除不再使用的convertFileSrc导入
- 添加详细的控制台日志便于调试
- 确保跨平台文件路径兼容性

现在缩略图可以正确显示,不会因为权限问题导致加载失败。
This commit is contained in:
imeepos
2025-07-15 22:38:22 +08:00
parent 723575ba7e
commit 44f3f40705
11 changed files with 68 additions and 1510 deletions

8
Cargo.lock generated
View File

@@ -1672,6 +1672,12 @@ dependencies = [
"pin-project-lite",
]
[[package]]
name = "http-range"
version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "21dec9db110f5f872ed9699c3ecf50cf16f423502706ba5c72462e28d3157573"
[[package]]
name = "httparse"
version = "1.10.1"
@@ -2304,6 +2310,7 @@ name = "mixvideo-desktop"
version = "0.1.9"
dependencies = [
"anyhow",
"base64 0.22.1",
"chrono",
"dirs 5.0.1",
"lazy_static",
@@ -4184,6 +4191,7 @@ dependencies = [
"gtk",
"heck 0.5.0",
"http 1.3.1",
"http-range",
"jni",
"libc",
"log",