fix(telegram): improve gif handling

This commit is contained in:
Peter Steinberger committed 2026-01-06 02:22:19 +00:00
1 parent 45c67a48af
commit cc0ef4d012
8 files changed
+209 -15

No files matched your search

+11
View File
@@ -107,6 +107,17 @@ export function extensionForMime(mime?: string | null): string | undefined {
return EXT_BY_MIME[mime.toLowerCase()];
}
export function isGifMedia(opts: {
contentType?: string | null;
fileName?: string | null;
}): boolean {
if (opts.contentType?.toLowerCase() === "image/gif") return true;
const ext = opts.fileName
? path.extname(opts.fileName).toLowerCase()
: undefined;
return ext === ".gif";
}
export function imageMimeFromFormat(
format?: string | null,
): string | undefined {