From 3436936349042d67c9e13e2362ab10ee760fc92d Mon Sep 17 00:00:00 2001 From: Bernard Xie Date: Thu, 17 Nov 2022 18:30:02 -0800 Subject: [PATCH] Remove maxWidth for png exports --- lib/png/generate_png.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/png/generate_png.js b/lib/png/generate_png.js index 99eccc61e..1b9f7d703 100644 --- a/lib/png/generate_png.js +++ b/lib/png/generate_png.js @@ -1,5 +1,4 @@ async (imgString) => { - const exportMaxWidth = 4000; const tempImg = new Image(); const loadImage = () => { return new Promise((resolve, reject) => { @@ -12,8 +11,8 @@ async (imgString) => { }; const img = await loadImage(); const canvas = document.createElement("canvas"); - canvas.width = Math.min(img.width, exportMaxWidth); - canvas.height = (canvas.width * img.height) / img.width; + canvas.width = img.width; + canvas.height = img.height; const ctx = canvas.getContext("2d"); if (!ctx) { return "";