fix(telegram): improve gif handling

This commit is contained in:
Peter Steinberger
2026-01-06 02:22:09 +00:00
parent 45c67a48af
commit cc0ef4d012
8 changed files with 209 additions and 15 deletions

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 {