PromiseベースでImage().onloadする - Qiita

#やりたいことJavaScriptで、画像の width/height が知りたいとき、以下のようにする。const img = new Image();img.onload = () => …