From eee64e363fd02df99411ad28ca12e316fbc59115 Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Fri, 5 Dec 2025 02:45:39 +0000 Subject: [PATCH] Skip compression for GIF emoji uploads to preserve animation (#10792) * Initial plan * Skip compression for GIF files to preserve animation Co-authored-by: tommoor <380914+tommoor@users.noreply.github.com> * Simplify type assertions in tests Co-authored-by: tommoor <380914+tommoor@users.noreply.github.com> * Remove unnecessary test file Co-authored-by: tommoor <380914+tommoor@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: tommoor <380914+tommoor@users.noreply.github.com> --- app/components/EmojiCreateDialog.tsx | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/app/components/EmojiCreateDialog.tsx b/app/components/EmojiCreateDialog.tsx index 64a830deef..36f2ffab7f 100644 --- a/app/components/EmojiCreateDialog.tsx +++ b/app/components/EmojiCreateDialog.tsx @@ -108,12 +108,16 @@ export function EmojiCreateDialog({ onSubmit }: Props) { setIsUploading(true); try { - const compressed = await compressImage(file, { - maxHeight: 64, - maxWidth: 64, - }); + // Skip compression for GIFs to preserve animation + const fileToUpload = + file.type === "image/gif" + ? file + : await compressImage(file, { + maxHeight: 64, + maxWidth: 64, + }); - const attachment = await uploadFile(compressed, { + const attachment = await uploadFile(fileToUpload, { name: file.name, preset: AttachmentPreset.Emoji, });