Skip to content

Commit

Permalink
refactor: decrease image quality on matches and train page to reduce …
Browse files Browse the repository at this point in the history
…load
  • Loading branch information
jakowenko committed Jul 21, 2021
1 parent 60e3c74 commit 374e4d9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions api/src/controllers/match.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ module.exports.get = async (req, res) => {
output.file = matchProp.file;
} else if (fs.existsSync(`${STORAGE.PATH}/${key}`)) {
const base64 = await sharp(`${STORAGE.PATH}/${key}`)
.jpeg({ quality: 70 })
.resize(500)
.withMetadata()
.toBuffer();
Expand Down
1 change: 1 addition & 0 deletions api/src/controllers/train.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ module.exports.get = async (req, res) => {

if (fs.existsSync(`${STORAGE.PATH}/${key}`)) {
const base64 = await sharp(`${STORAGE.PATH}/${key}`)
.jpeg({ quality: 70 })
.resize(500)
.withMetadata()
.toBuffer();
Expand Down

0 comments on commit 374e4d9

Please sign in to comment.