Remove maxWidth for png exports

This commit is contained in:
Bernard Xie 2022-11-17 18:30:02 -08:00
parent 6bec385811
commit 3436936349
No known key found for this signature in database
GPG key ID: 3C3E0036CE0F892C

View file

@ -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 "";