mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46:12 +01:00
feat: add filter:image.stripEXIF
This commit is contained in:
@@ -107,6 +107,12 @@ image.stripEXIF = async function (path) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
try {
|
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 buffer = await fs.promises.readFile(path);
|
||||||
const sharp = requireSharp();
|
const sharp = requireSharp();
|
||||||
await sharp(buffer, { failOnError: true }).rotate().toFile(path);
|
await sharp(buffer, { failOnError: true }).rotate().toFile(path);
|
||||||
|
|||||||
Reference in New Issue
Block a user