diff --git a/app/file-upload/server/lib/FileUpload.js b/app/file-upload/server/lib/FileUpload.js index b6e2d36bd770..b109b9b0836f 100644 --- a/app/file-upload/server/lib/FileUpload.js +++ b/app/file-upload/server/lib/FileUpload.js @@ -266,7 +266,7 @@ export const FileUpload = { }, uploadsOnValidate(file) { - if (!/^image\/((x-windows-)?bmp|p?jpeg|png)$/.test(file.type)) { + if (!/^image\/((x-windows-)?bmp|p?jpeg|png|gif)$/.test(file.type)) { return; } diff --git a/client/components/Message/Attachments/components/Image.tsx b/client/components/Message/Attachments/components/Image.tsx index b236ae332e4f..c5898bbb389d 100644 --- a/client/components/Message/Attachments/components/Image.tsx +++ b/client/components/Message/Attachments/components/Image.tsx @@ -60,10 +60,10 @@ const getDimensions = (width: Dimensions['width'], height: Dimensions['height'], const ratio = height / width; if (height >= width || Math.min(width, limits.width) * ratio > limits.height) { - return { width: width * Math.min(height, limits.height) / height, height: Math.min(height, limits.height) }; + return { width: width * Math.min(height, limits.height) / height, height: 'auto' }; } - return { width: Math.min(width, limits.width), height: height * Math.min(width, limits.width) / width }; + return { width: Math.min(width, limits.width), height: 'auto' }; }; const Image: FC = ({ previewUrl, loadImage = true, setLoadImage, src, ...size }) => {