Skip to content

Node.js based forum software built for the modern web

feat: add filter:image.stripEXIF

Barış Soner Uşaklıb8765df5f48b
diff --git a/src/image.js b/src/image.js
index f1cce078cb..2374693aa0 100644
--- a/src/image.js
+++ b/src/image.js
@@ -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);