public static function getImageDimensions($filePath) { list($width, $height, $type) = getimagesize($filePath); return (object) ['width' => $width, 'height' => $height, 'mime' => image_type_to_mime_type($type)]; }