From b517177b530b0d3c261ceb7933b318386f55a655 Mon Sep 17 00:00:00 2001 From: mskec Date: Sat, 18 Nov 2023 15:52:46 +0100 Subject: [PATCH] feat(preserveAspectRatio): added option to preserve aspect ratio When set to true and both width and height are specified, they are interpreted as the minimum width and minimum height, respectively. If set to true with only the width specified, the height will be automatically determined while preserving the aspect ratio, and vice versa. fixes #88, #189 --- src/graphics.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/graphics.ts b/src/graphics.ts index 85821e4..b7c7d68 100644 --- a/src/graphics.ts +++ b/src/graphics.ts @@ -39,7 +39,6 @@ export class Graphics { } public gmBaseCommand(stream: fs.ReadStream, filename: string): gm.State { - // console.log(JSON.stringify({ width: this.width, height: this.height, preserveAspectRatio: this.preserveAspectRatio, density: this.density })) return this.gm(stream, filename) .density(this.density, this.density) .resize(this.width, this.height, this.preserveAspectRatio ? '^' : '!')