Hello,
is there a way to get the original size of a tumult hype image element?
I need to load different images with different size keeping a specific height value.
So I need to calculate the width and I need the origina w/h ratio.
Thanks,
Andrea.
P.S
I'd like to not using promises like this:
function loadImageSize (path) {
return new Promise((resolve, reject) => {
const img = new Image()
img.src = path
img.onload = () => {
resolve({"w":img.width, "h":img.height})
}
img.onerror = e => {
reject(e)
}
})
}