From 4332dece44d6f4072f582da90b6ed4a988e7e34e Mon Sep 17 00:00:00 2001 From: Aravind Reddy V Date: Wed, 4 Aug 2021 20:39:36 +0530 Subject: [PATCH] Support svgShortCircuit --- img.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/img.js b/img.js index d41c490..b6939c8 100644 --- a/img.js +++ b/img.js @@ -309,7 +309,12 @@ async function resizeImage(src, options = {}) { let fullStats = getFullStats(src, metadata, options); for(let outputFormat in fullStats) { for(let stat of fullStats[outputFormat]) { - if(options.useCache && !options.svgShortCircuit && fs.existsSync(stat.outputPath)){ + if(options.useCache && fs.existsSync(stat.outputPath)){ + stat.size = fs.statSync(stat.outputPath).size; + if(options.dryRun) { + stat.buffer = fs.readFileSync(src); + } + outputFilePromises.push(Promise.resolve(stat)); continue; }