Tweaked Extract Files minimum size

This commit is contained in:
n1474335 2022-07-08 14:49:40 +01:00
parent bb6c1c54ff
commit fc95d82c49

View File

@ -58,7 +58,7 @@ class ExtractFiles extends Operation {
{ {
name: "Minimum File Size", name: "Minimum File Size",
type: "number", type: "number",
value: 0 value: 100
} }
]); ]);
} }
@ -86,8 +86,8 @@ class ExtractFiles extends Operation {
const errors = []; const errors = [];
detectedFiles.forEach(detectedFile => { detectedFiles.forEach(detectedFile => {
try { try {
let file; const file = extractFile(bytes, detectedFile.fileDetails, detectedFile.offset);
if ((file = extractFile(bytes, detectedFile.fileDetails, detectedFile.offset)).size >= minSize) if (file.size >= minSize)
files.push(file); files.push(file);
} catch (err) { } catch (err) {
if (!ignoreFailedExtractions && err.message.indexOf("No extraction algorithm available") < 0) { if (!ignoreFailedExtractions && err.message.indexOf("No extraction algorithm available") < 0) {