Skip to content

Commit

Permalink
Don't enlarge image when resizing canvas
Browse files Browse the repository at this point in the history
  • Loading branch information
freelock committed Nov 29, 2018
1 parent 23c7b3d commit 81bd66a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions visualify-compare.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,15 @@ async function imageDiff(items, config) {
console.log(chalk.yellow(`img2 narrower. Changing ${img2.width} to ${width}.`));
img2 = await sharp2
.resize({width, position:"left"})
.withoutEnlargement()
.toBuffer();
img2 = PNG.sync.read(img2);
img2changed = true;
} else {
console.log(chalk.yellow(`img1 narrower. Changing ${img1.width} to ${width}.`));
img1 = await sharp1
.resize({width, position:"left"})
.withoutEnlargement()
.toBuffer();
img1 = PNG.sync.read(img1);
img1changed = true;
Expand Down

0 comments on commit 81bd66a

Please sign in to comment.