mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-29 02:52:27 +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) {
|
||||
if (isSvg(buffer)) {
|
||||
return {
|
||||
ext: 'svg'
|
||||
}
|
||||
if (isSvg(buffer.toString())) {
|
||||
return { ext: 'svg' }
|
||||
}
|
||||
else {
|
||||
return imageType(buffer) || {
|
||||
ext: "jpg"
|
||||
}; // optimistic JPG default
|
||||
return imageType(buffer) || { ext: "jpg" }; // optimistic JPG default
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user