Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ffmpeg 导出 webp 格式的 thumbnail 和 frame,可以解决透明图的问题 #72

Open
3 tasks
web3nomad opened this issue May 28, 2024 · 1 comment
Open
3 tasks
Labels
enhancement Improvements

Comments

@web3nomad
Copy link
Member

web3nomad commented May 28, 2024

          有个地方可以改下,让 ffmpeg 导出 webp 格式的 thumbnail 和 frame,可以解决透明图的问题

Originally posted by @web3nomad in #66 (comment)

因为现在统一用 ffmpeg 给 image 和 video 生成了 thumbnail 和 frame,对于透明底的图片,thumbnail 和 frame 的透明底就没了,分别影响素材库和搜索结果的预览。

所以可以考虑 webp,视频和图片就都直接用 webp,目前看起来对展示和读取都没有影响,并且 rust 的 image crate 默认就能读取 webp

不过这个需要测试下 windows 下面 webview 的显示有没有问题。

要改动的地方

  • 后端 THUMBNAIL_FILE_NAME 和 FRAME_FILE_EXTENSION 常量
  • 前端 getThumbnailSrc 方法, 前端获取 frame 图片和 thumbnail 图片都写死了前缀
  • 其他 (TBA)
@web3nomad
Copy link
Member Author

这个先等 #59 里面提到的 "在 artifacts 里面把 thumbnail 的图片记录下来" 修改下

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improvements
Projects
None yet
Development

No branches or pull requests

1 participant