feat: add filter:image.stripEXIF

This commit is contained in:
Barış Soner Uşaklı
2022-03-31 14:58:43 -04:00
parent 200f0b2e4f
commit b8765df5f4

View File

@@ -107,6 +107,12 @@ image.stripEXIF = async function (path) {
return;
}
try {
if (plugins.hooks.hasListeners('filter:image.stripEXIF')) {
await plugins.hooks.fire('filter:image.stripEXIF', {
path: path,
});
return;
}
const buffer = await fs.promises.readFile(path);
const sharp = requireSharp();
await sharp(buffer, { failOnError: true }).rotate().toFile(path);