Skip to content

Commit

Permalink
Support svgShortCircuit
Browse files Browse the repository at this point in the history
  • Loading branch information
zeroby0 committed Aug 4, 2021
1 parent f265638 commit 4332dec
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion img.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 4332dec

Please sign in to comment.