From b97b15c947348709ad802493564e17400067185e Mon Sep 17 00:00:00 2001 From: TomasDurica Date: Sat, 23 Nov 2024 19:08:55 +0100 Subject: [PATCH] Fixed thumbnail background --- raw/products/products-data-generator.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/raw/products/products-data-generator.js b/raw/products/products-data-generator.js index 0a0593f..ae98828 100644 --- a/raw/products/products-data-generator.js +++ b/raw/products/products-data-generator.js @@ -169,7 +169,7 @@ function generateThumbnailImage(product) { const image = `${dir}/${folder[0]}`; const sharpImage = sharp(image); - const resizedImage = sharpImage.resize({ width: 300, height: 300, fit: 'contain' }); + const resizedImage = sharpImage.resize({ width: 300, height: 300, fit: 'contain', background: "transparent" }); const pngImage = resizedImage.png(); if (fs.existsSync(`${dir}/thumbnail.png`)) {