revert 0ffcafdf3f35f7d9ac27b6b4f65d3b283ef03a49
All checks were successful
Neutral/pipeline/head This commit looks good

revert Version 1.1.0 - Ajout de la compatibilité des images
This commit is contained in:
2024-12-29 14:53:37 +00:00
parent ee556d859e
commit 52e1348613
3 changed files with 42 additions and 64 deletions

View File

@ -163,15 +163,8 @@ module.exports.getFile = function(root) {
if(fs.existsSync(root)) {
try {
// Check if the file is an image and if it is return the base64
if(mime.lookup(root).includes("image")) {
return "data:" + mime.lookup(root) + ";base64," + fs.readFileSync(root, "base64")
} else {
return fs.readFileSync(root, "utf-8")
}
return fs.readFileSync(root, "utf-8")
} catch(err) {
console.log(err)
return "NOT_PERMITTED"