public function setPreviewImage(SecureImage $Img) { if (!$this->PreviewImage() instanceof VideoImage) { if ($this->PreviewImage()->exists()) { $this->PreviewImage()->delete(); } } $this->PreviewImageID = $Img->ID; $lib = new \Vimeo\Vimeo(Config::inst()->get('VimeoVideoFile', 'client_id'), Config::inst()->get('VimeoVideoFile', 'client_secret'), Config::inst()->get('VimeoVideoFile', 'access_token')); $video_data = $lib->uploadImage($this->VimeoURI . '/pictures', $Img->getFullPath(), true); // Upload the PreviewPicture as $this->appendLog($this->getLogFile(), 'New Image uploaded', print_r($video_data, true)); $this->write(); }