Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] No rotate option, to prevent image quality loss #15196

Merged
merged 12 commits into from
Jun 19, 2020
2 changes: 1 addition & 1 deletion app/file-upload/server/lib/FileUpload.js
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ export const FileUpload = {
};

const reorientation = (cb) => {
if (!metadata.orientation) {
if (!metadata.orientation || metadata.orientation === 1 || settings.get('FileUpload_RotateImages') !== true) {
return cb();
}
s.rotate()
Expand Down
4 changes: 4 additions & 0 deletions app/file-upload/server/startup/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ settings.addGroup('FileUpload', function() {
i18nDescription: 'FileUpload_ProtectFilesDescription',
});

this.add('FileUpload_RotateImages', true, {
rodrigok marked this conversation as resolved.
Show resolved Hide resolved
type: 'boolean',
});

this.add('FileUpload_Enable_json_web_token_for_files', true, {
type: 'boolean',
i18nLabel: 'FileUpload_Enable_json_web_token_for_files',
Expand Down
2 changes: 2 additions & 0 deletions packages/rocketchat-i18n/i18n/en.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -1611,6 +1611,8 @@
"FileUpload_MediaTypeWhiteListDescription": "Comma-separated list of media types. Leave it blank for accepting all media types.",
"FileUpload_ProtectFiles": "Protect Uploaded Files",
"FileUpload_ProtectFilesDescription": "Only authenticated users will have access",
"FileUpload_RotateImages": "Rotate images on upload",
"FileUpload_RotateImages_Description": "Enabling this setting may cause image quality loss",
"FileUpload_S3_Acl": "Acl",
"FileUpload_S3_AWSAccessKeyId": "Access Key",
"FileUpload_S3_AWSSecretAccessKey": "Secret Key",
Expand Down