fix truncation
This commit is contained in:
parent
718b912719
commit
a22bf58719
1 changed files with 2 additions and 1 deletions
3
lib.js
3
lib.js
|
@ -40,7 +40,6 @@ async function splitUp(content) {
|
|||
let san = sanitize(path.split('/').pop(), '');
|
||||
try {
|
||||
content = await readFile(`${process.cwd()}/uploads/${san}`, 'utf-8');
|
||||
content.length = Math.min(content.length,5000);
|
||||
} catch (err) {
|
||||
content = '';
|
||||
}
|
||||
|
@ -62,6 +61,8 @@ async function splitUp(content) {
|
|||
height = contentJson.height;
|
||||
}
|
||||
|
||||
content = content.slice(0,Math.min(content.length,4000) - 1);
|
||||
|
||||
out[i] = { type: 'file', path, ext, content, width, height, encoded };
|
||||
continue;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue