From: Tim Düsterhus Date: Fri, 29 Mar 2019 14:31:03 +0000 (+0100) Subject: Move around logic for resulting file type of autoscaling X-Git-Tag: 5.2.0_Alpha_1~124^2~6 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=2986d69b169be9779415bcef874b39ccf2f376f9;p=GitHub%2FWoltLab%2FWCF.git Move around logic for resulting file type of autoscaling --- 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;