Disable attachment scaling for GIFs
authorTim Düsterhus <duesterhus@woltlab.com>
Fri, 26 Feb 2021 11:01:57 +0000 (12:01 +0100)
committerTim Düsterhus <duesterhus@woltlab.com>
Fri, 26 Feb 2021 11:01:57 +0000 (12:01 +0100)
Resolves #4030

wcfsetup/install/files/js/WCF.Attachment.js

index 80c031f577686420e8ec9a5c491c40dee73f5aff..34ff910301e24eeb3062ebc3edacb9e14a3fb0bf 100644 (file)
@@ -335,8 +335,9 @@ WCF.Attachment.Upload = WCF.Upload.extend({
                                // As our resizer is based on Pica it will use multiple workers per image if possible.
                                promise = Array.prototype.reduce.call(files, (function (acc, file) {
                                        return acc.then((function (arr) {
-                                               // Ignore anything that is not one of the 3 basic image types.
-                                               if (['image/png', 'image/gif', 'image/jpeg'].indexOf(file.type) === -1) {
+                                               // Ignore anything that is neither PNG nor JPEG. GIFs are not supported
+                                               // due to the support for animations.
+                                               if (['image/png', 'image/jpeg'].indexOf(file.type) === -1) {
                                                        arr.push(file);
                                                        return arr;
                                                }