mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-30 03:32:26 +08:00
chore(deps): adapt to is-svg v5
This commit is contained in:
parent
99cb751cab
commit
c9874e6b2f
@ -45,15 +45,11 @@ async function processImage(uploadBuffer: Buffer, originalName: string, shrinkIm
|
|||||||
}
|
}
|
||||||
|
|
||||||
function getImageType(buffer: Buffer) {
|
function getImageType(buffer: Buffer) {
|
||||||
if (isSvg(buffer)) {
|
if (isSvg(buffer.toString())) {
|
||||||
return {
|
return { ext: 'svg' }
|
||||||
ext: 'svg'
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return imageType(buffer) || {
|
return imageType(buffer) || { ext: "jpg" }; // optimistic JPG default
|
||||||
ext: "jpg"
|
|
||||||
}; // optimistic JPG default
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user