Beispiel #1
0
 public function setProfileCover(ImageProcessor $imageProcessor)
 {
     $this->scope->addScope(['user_photos', 'publish_actions']);
     $this->request(Method::METHOD_POST, 'photos', [], [], ['source' => $imageProcessor->getOriginalImageFile()]);
     if (!isset($this->responseData->id)) {
         throw new MalformedResponseException('Expected facebook response to carry media id and post id');
     }
     //header('Location: https://www.facebook.com/'.$this->getUserId().'?preview_cover='.$this->responseData->id);
 }
Beispiel #2
0
 public function setProfileCover(ImageProcessor $imageProcessor)
 {
     $bytesLimit = 1024 * 1024;
     if ($imageProcessor->getSize() < $bytesLimit) {
         $this->request(Method::METHOD_POST, 'account/update_profile_banner', [], [], ['banner' => $imageProcessor->getOriginalImageFile()]);
     } else {
         $imageProcessor->resizeByBytes($bytesLimit);
         $this->request(Method::METHOD_POST, 'account/update_profile_banner', [], [], ['banner' => $imageProcessor->getProcessedImageFile()]);
     }
 }