I'm using tsayen's dom-to-image library to snapshot an image element. The intrinsic size of my image is close to 1000x1000px, but on my website I have it scaled down to about 500x500px. I'm wanting to scale the image back to its intrinsic size before the dom-to-image renders it. This is what I've tried to use:
HTML:
<div class="container" id="node">
<img class="mz_img" src="/MZ.jpg" />
</div>
JS:
domtoimage
.toPng(node, {
style: {
width: "1100px",
height: "1256px",
},
})
This outputs an almost entirely back 1100x1256 image, with my "mz_img" image displaced almost completely out of frame. I've tried about five different ways for scaling up the image before render, and they all produce completely unpredictable (and unusable) results. What's the best method for scaling up an image before render?