While working on T353147, we had to use getimagesize() to get the size of images and this works almost like Less.JS image-size library. The downside to using the PHP getimagesize function is that it doesn’t support SVG images.
To fix this, we are going to implement a helper function to get the size of SVG images like how image-size does it. see https://github.com/image-size/image-size/blob/main/lib/types/svg.ts