Skip to content

Commit

Permalink
fix(core): image data removal
Browse files Browse the repository at this point in the history
  • Loading branch information
polonel committed May 28, 2022
1 parent b7c1518 commit ae904d3
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/controllers/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -655,6 +655,9 @@ mainController.uploadFavicon = function (req, res) {
}

if (!fs.existsSync(object.filePath)) return res.status(400).send('File failed to save to disk')
if (path.extname(object.filename) === '.jpg' || path.extname(object.filename) === '.jpeg') {
require('../helpers/utils').stripExifData(object.filePath)
}

settingUtil.setSetting('gen:customfavicon', true, function (err) {
if (err) return res.status(400).send('Failed to save setting to database')
Expand Down Expand Up @@ -727,6 +730,9 @@ mainController.uploadLogo = function (req, res) {
}

if (!fs.existsSync(object.filePath)) return res.status(400).send('File failed to save to disk')
if (path.extname(object.filename) === '.jpg' || path.extname(object.filename) === '.jpeg') {
require('../helpers/utils').stripExifData(object.filePath)
}

settingUtil.setSetting('gen:customlogo', true, function (err) {
if (err) return res.status(400).send('Failed to save setting to database')
Expand Down Expand Up @@ -800,6 +806,9 @@ mainController.uploadPageLogo = function (req, res) {
}

if (!fs.existsSync(object.filePath)) return res.status(400).send('File failed to save to disk')
if (path.extname(object.filename) === '.jpg' || path.extname(object.filename) === '.jpeg') {
require('../helpers/utils').stripExifData(object.filePath)
}

settingUtil.setSetting('gen:custompagelogo', true, function (err) {
if (err) return res.status(400).send('Failed to save setting to database')
Expand Down

0 comments on commit ae904d3

Please sign in to comment.