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 @@ -244,7 +244,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
6 changes: 6 additions & 0 deletions app/file-upload/server/startup/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ settings.addGroup('FileUpload', function() {
i18nDescription: 'FileUpload_ProtectFilesDescription',
});

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

this.add('FileUpload_Storage_Type', 'GridFS', {
type: 'select',
values: [{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ html.rtl .attachment {
margin-top: 4px;

line-height: 0;

image-orientation: from-image;
stleitner marked this conversation as resolved.
Show resolved Hide resolved
stleitner marked this conversation as resolved.
Show resolved Hide resolved
}

& .attachment-fields {
Expand Down
1 change: 1 addition & 0 deletions packages/rocketchat-i18n/i18n/en.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -1409,6 +1409,7 @@
"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_RotateImagesDescription": "Rotate images on upload, may cause image quality loss",
stleitner marked this conversation as resolved.
Show resolved Hide resolved
"FileUpload_S3_Acl": "Acl",
"FileUpload_S3_AWSAccessKeyId": "Access Key",
"FileUpload_S3_AWSSecretAccessKey": "Secret Key",
Expand Down