diff --git a/src/routes/api/image.js b/src/routes/api/image.js index 22406e171..61ce9b516 100644 --- a/src/routes/api/image.js +++ b/src/routes/api/image.js @@ -38,7 +38,7 @@ async function uploadImage(req) { return [400, "Unknown image type: " + file.mimetype]; } - const {url} = await imageService.saveImage(file.buffer, file.originalname, noteId); + const {url} = await imageService.saveImage(file.buffer, file.originalname, noteId, true); return { uploaded: true, diff --git a/src/routes/api/sender.js b/src/routes/api/sender.js index 4c1fee9da..81a61b245 100644 --- a/src/routes/api/sender.js +++ b/src/routes/api/sender.js @@ -38,7 +38,7 @@ async function uploadImage(req) { const parentNote = await dateNoteService.getDateNote(req.headers['x-local-date']); - const {noteId} = await imageService.saveImage(file.buffer, "Sender image", parentNote.noteId); + const {noteId} = await imageService.saveImage(file.buffer, "Sender image", parentNote.noteId, true); return { noteId: noteId diff --git a/src/services/import/enex.js b/src/services/import/enex.js index 13f17bfb7..4625d62bd 100644 --- a/src/services/import/enex.js +++ b/src/services/import/enex.js @@ -251,7 +251,7 @@ async function importEnex(importContext, file, parentNote) { try { const originalName = "image." + resource.mime.substr(6); - const {url} = await imageService.saveImage(resource.content, originalName, noteEntity.noteId); + const {url} = await imageService.saveImage(resource.content, originalName, noteEntity.noteId, importContext.shrinkImages); const imageLink = ``;