You can find any extension using “ext” in above example.
Call a simple function passing url of the image you want the size of. Size can be calculated in KB, MB or GB. If you want the size in KB then divide it by 1000. If in GB divide it by 1000000000 (1e+9).