Skip to content

Commit

Permalink
Use sharp new API for resize image previews (#12980)
Browse files Browse the repository at this point in the history
  • Loading branch information
tassoevan authored and rodrigok committed Dec 19, 2018
1 parent f98945e commit 46dfdfd
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions packages/rocketchat-file-upload/server/lib/FileUpload.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,7 @@ Object.assign(FileUpload, {
const image = FileUpload.getStore('Uploads')._store.getReadStream(file._id, file);

const transformer = sharp()
.resize(32, 32)
.max()
.resize({ width: 32, height: 32, fit: 'inside' })
.jpeg()
.blur();
const result = transformer.toBuffer().then((out) => out.toString('base64'));
Expand Down

0 comments on commit 46dfdfd

Please sign in to comment.