From 9cf1180f9880331ecf076faf0f66f19cb22dbe4f Mon Sep 17 00:00:00 2001 From: Chen Levy Date: Tue, 9 Jun 2020 10:44:39 +0000 Subject: [PATCH] Fixed the bug that converted svg's in low quality --- packages/core/src/lib/TwaGenerator.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/core/src/lib/TwaGenerator.ts b/packages/core/src/lib/TwaGenerator.ts index 4e7c4d5c..bd86a229 100644 --- a/packages/core/src/lib/TwaGenerator.ts +++ b/packages/core/src/lib/TwaGenerator.ts @@ -142,7 +142,8 @@ export class TwaGenerator { } private async saveIcon(data: Buffer, size: number, fileName: string): Promise { - await sharp(data) + // 2400 is the maximal density which gets the best quality. + await sharp(data, {density: 2400}) .resize(size) .png() .toFile(fileName);