'jpeg', 'jpeg' => 'jpeg', 'png' => 'png', 'gif' => 'gif', 'bmp' => 'bmp', ]; public function load($file = null, $driver = null) { if(empty($file) || !realpath($file)) { throw new ErrorException('File name can not be empty and exists'); } return Image::factory($file, $driver ? $driver : $this->driver); } }