From 2986d69b169be9779415bcef874b39ccf2f376f9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Fri, 29 Mar 2019 15:31:03 +0100 Subject: [PATCH] Move around logic for resulting file type of autoscaling --- wcfsetup/install/files/js/WCF.Attachment.js | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/wcfsetup/install/files/js/WCF.Attachment.js b/wcfsetup/install/files/js/WCF.Attachment.js index b2c7b62b99..eb95572282 100644 --- a/wcfsetup/install/files/js/WCF.Attachment.js +++ b/wcfsetup/install/files/js/WCF.Attachment.js @@ -324,10 +324,6 @@ if (COMPILER_TARGET_DEFAULT) { var maxHeight = this._options.autoScale.maxHeight; var quality = this._options.autoScale.quality; - if (this._options.autoScale.fileType !== 'keep') { - resizer.setFileType(this._options.autoScale.fileType); - } - // Resize the images in series. // 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) { @@ -342,11 +338,7 @@ if (COMPILER_TARGET_DEFAULT) { var promise = resizer.resize(file, maxWidth, maxHeight, quality, file.size > maxSize, timeout) .then((function (result) { - if (result.image instanceof File) { - return result.image; - } - - var fileType = undefined; + var fileType = this._options.autoScale.fileType; if (this._options.autoScale.fileType === 'keep') { fileType = file.type; -- 2.20.1