I use below way to get an image size from a URL:
const img = new Image();
img.onload = () => {
const imageSize = {
x: img.width,
y: img.height
};
resolve(imageSize);
};
img.src = imageUrl;
basically it loads the whole image and determine its size. I wonder there is any other way to get it without downloading the full image. Is there a header I can load to read the image's size?