Remove maxWidth for png exports
This commit is contained in:
parent
6bec385811
commit
3436936349
1 changed files with 2 additions and 3 deletions
|
|
@ -1,5 +1,4 @@
|
||||||
async (imgString) => {
|
async (imgString) => {
|
||||||
const exportMaxWidth = 4000;
|
|
||||||
const tempImg = new Image();
|
const tempImg = new Image();
|
||||||
const loadImage = () => {
|
const loadImage = () => {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
|
|
@ -12,8 +11,8 @@ async (imgString) => {
|
||||||
};
|
};
|
||||||
const img = await loadImage();
|
const img = await loadImage();
|
||||||
const canvas = document.createElement("canvas");
|
const canvas = document.createElement("canvas");
|
||||||
canvas.width = Math.min(img.width, exportMaxWidth);
|
canvas.width = img.width;
|
||||||
canvas.height = (canvas.width * img.height) / img.width;
|
canvas.height = img.height;
|
||||||
const ctx = canvas.getContext("2d");
|
const ctx = canvas.getContext("2d");
|
||||||
if (!ctx) {
|
if (!ctx) {
|
||||||
return "";
|
return "";
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue