mirror of
https://github.com/zadam/trilium.git
synced 2025-10-29 09:16:45 +01:00
pasted images should have trimmed names if too long (too often it's just garbage), closes #2307
This commit is contained in:
@@ -270,7 +270,7 @@ async function downloadImage(noteId, imageUrl) {
|
||||
const title = path.basename(parsedUrl.pathname);
|
||||
|
||||
const imageService = require('../services/image');
|
||||
const {note} = imageService.saveImage(noteId, imageBuffer, title, true);
|
||||
const {note} = imageService.saveImage(noteId, imageBuffer, title, true, true);
|
||||
|
||||
note.addLabel('imageUrl', imageUrl);
|
||||
|
||||
@@ -305,7 +305,7 @@ function downloadImages(noteId, content) {
|
||||
const imageBuffer = Buffer.from(imageBase64, 'base64');
|
||||
|
||||
const imageService = require('../services/image');
|
||||
const {note} = imageService.saveImage(noteId, imageBuffer, "inline image", true);
|
||||
const {note} = imageService.saveImage(noteId, imageBuffer, "inline image", true, true);
|
||||
|
||||
content = content.substr(0, imageMatch.index)
|
||||
+ `<img src="api/images/${note.noteId}/${note.title}"`
|
||||
|
||||
Reference in New Issue
Block a user