mirror of
https://github.com/outline/outline.git
synced 2026-11-22 14:01:41 +03:00
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>
This commit is contained in:
1 parent
55116b4761
commit
eee64e363f
1 file changed
+9
-5
@@ -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,
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user