mirror of
https://github.com/zadam/trilium.git
synced 2024-11-11 01:23:57 +08:00
switchable image shrinking
This commit is contained in:
parent
51bbc10744
commit
b7bd94b6b0
3 changed files with 3 additions and 3 deletions
|
@ -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,
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 = `<img src="${url}">`;
|
||||
|
||||
|
|
Loading…
Reference in a new issue