function getWidth($path) { try { $image = new BrImage($path); return $image->width(); } catch (Exception $e) { return 0; } }