Merge branch 'master' into develop

This commit is contained in:
Barış Soner Uşaklı
2025-11-19 08:45:35 -05:00
2 changed files with 4 additions and 3 deletions

View File

@@ -61,7 +61,7 @@ async function uploadAsImage(req, uploadedFile) {
throw new Error('[[error:no-privileges]]'); throw new Error('[[error:no-privileges]]');
} }
await image.checkDimensions(uploadedFile.path); await image.checkDimensions(uploadedFile.path);
await image.stripEXIF(uploadedFile.path); await image.stripEXIF({ path: uploadedFile.path, type: uploadedFile.type });
if (plugins.hooks.hasListeners('filter:uploadImage')) { if (plugins.hooks.hasListeners('filter:uploadImage')) {
return await plugins.hooks.fire('filter:uploadImage', { return await plugins.hooks.fire('filter:uploadImage', {

View File

@@ -102,14 +102,15 @@ image.size = async function (path) {
return imageData ? { width: imageData.width, height: imageData.height } : undefined; return imageData ? { width: imageData.width, height: imageData.height } : undefined;
}; };
image.stripEXIF = async function (path) { image.stripEXIF = async function ({ path, type }) {
if (!meta.config.stripEXIFData || path.endsWith('.gif') || path.endsWith('.svg')) { if (!meta.config.stripEXIFData || type === 'image/gif' || type === 'image/svg+xml') {
return; return;
} }
try { try {
if (plugins.hooks.hasListeners('filter:image.stripEXIF')) { if (plugins.hooks.hasListeners('filter:image.stripEXIF')) {
await plugins.hooks.fire('filter:image.stripEXIF', { await plugins.hooks.fire('filter:image.stripEXIF', {
path: path, path: path,
type: type,
}); });
return; return;
} }