public static function getImageSize($filepath) { if (extension_loaded('gd')) { $image = new GD($filepath); return $image->getSize(); } }