perf: 转换 gif

close #32
This commit is contained in:
Clansty 2022-09-11 16:29:56 +08:00
parent efc3f07113
commit 9fe2f4c149
2 changed files with 14 additions and 2 deletions

View File

@ -6,6 +6,18 @@
libwebp
python3
ffmpeg
vips
(vips.override {
libjxl = pkgs.libjxl.overrideAttrs(attrs: {
doCheck = false;
});
})
openssl
];
shellHook = with pkgs; ''
export PRISMA_MIGRATION_ENGINE_BINARY="${prisma-engines}/bin/migration-engine"
export PRISMA_QUERY_ENGINE_BINARY="${prisma-engines}/bin/query-engine"
export PRISMA_QUERY_ENGINE_LIBRARY="${prisma-engines}/lib/libquery_engine.node"
export PRISMA_INTROSPECTION_ENGINE_BINARY="${prisma-engines}/bin/introspection-engine"
export PRISMA_FMT_BINARY="${prisma-engines}/bin/prisma-fmt"
'';
}

View File

@ -318,7 +318,7 @@ export default class ForwardService {
if (file.size.gt(50 * 1024 * 1024)) {
chain.push('[视频大于 50MB]');
}
else if (file.mimeType === 'video/webm') {
else if (file.mimeType === 'video/webm' || message.gif) {
// 把 webm 转换成 gif
const convertedPath = path.resolve(path.join('./data/cache/webm', message.document.id.toString(16) + '.gif'));
// 先从缓存中找