mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46:12 +01:00
fix: #7634, make strip exif configurable
This commit is contained in:
@@ -33,6 +33,7 @@
|
|||||||
"allowUserHomePage": 1,
|
"allowUserHomePage": 1,
|
||||||
"allowMultipleBadges": 0,
|
"allowMultipleBadges": 0,
|
||||||
"maximumFileSize": 2048,
|
"maximumFileSize": 2048,
|
||||||
|
"stripEXIFData": 1,
|
||||||
"resizeImageWidthThreshold": 2000,
|
"resizeImageWidthThreshold": 2000,
|
||||||
"resizeImageWidth": 760,
|
"resizeImageWidth": 760,
|
||||||
"rejectImageWidth": 5000,
|
"rejectImageWidth": 5000,
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
"posts": "Posts",
|
"posts": "Posts",
|
||||||
"allow-files": "Allow users to upload regular files",
|
"allow-files": "Allow users to upload regular files",
|
||||||
"private": "Make uploaded files private",
|
"private": "Make uploaded files private",
|
||||||
|
"strip-exif-data": "Strip EXIF Data",
|
||||||
"private-extensions": "File extensions to make private",
|
"private-extensions": "File extensions to make private",
|
||||||
"private-uploads-extensions-help": "Enter comma-separated list of file extensions to make private here (e.g. <code>pdf,xls,doc</code>). An empty list means all files are private.",
|
"private-uploads-extensions-help": "Enter comma-separated list of file extensions to make private here (e.g. <code>pdf,xls,doc</code>). An empty list means all files are private.",
|
||||||
"resize-image-width-threshold": "Resize images if they are wider than specified width",
|
"resize-image-width-threshold": "Resize images if they are wider than specified width",
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ var winston = require('winston');
|
|||||||
|
|
||||||
var file = require('./file');
|
var file = require('./file');
|
||||||
var plugins = require('./plugins');
|
var plugins = require('./plugins');
|
||||||
|
var meta = require('./meta');
|
||||||
|
|
||||||
var image = module.exports;
|
var image = module.exports;
|
||||||
|
|
||||||
@@ -92,7 +93,7 @@ image.size = function (path, callback) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
image.stripEXIF = function (path, callback) {
|
image.stripEXIF = function (path, callback) {
|
||||||
if (path.endsWith('.gif')) {
|
if (!meta.config.stripEXIFData || path.endsWith('.gif')) {
|
||||||
return setImmediate(callback);
|
return setImmediate(callback);
|
||||||
}
|
}
|
||||||
async.waterfall([
|
async.waterfall([
|
||||||
|
|||||||
@@ -20,6 +20,13 @@
|
|||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="checkbox">
|
||||||
|
<label class="mdl-switch mdl-js-switch mdl-js-ripple-effect">
|
||||||
|
<input class="mdl-switch__input" type="checkbox" data-field="stripEXIFData">
|
||||||
|
<span class="mdl-switch__label"><strong>[[admin/settings/uploads:strip-exif-data]]</strong></span>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="privateUploadsExtensions">[[admin/settings/uploads:private-extensions]]</label>
|
<label for="privateUploadsExtensions">[[admin/settings/uploads:private-extensions]]</label>
|
||||||
<input type="text" class="form-control" value="" data-field="privateUploadsExtensions" placeholder="">
|
<input type="text" class="form-control" value="" data-field="privateUploadsExtensions" placeholder="">
|
||||||
|
|||||||
Reference in New Issue
Block a user