Reputation: 45
I am using Facebook apis to publish post on my fb page.When I am uploading image to the fb page, image is not coming complete while it is cropped by fb when I see in console.
This is the code I am using
$data = [
'message' => 'dummy msg',
'link' => 'http://www.brainbubbling.com/',
'source' => 'http://localhost/fb_puzzles/test.png', //(for with url)
'published'=>true,
//"access_token" => $page->access_token
];
$fb->post('/'.$page->id.'/feed', $data, $page->access_token);
I am also attaching the screenshot of the image published on fb
I have tried different-2 images width and height as well but no luck. Please help
Upvotes: 0
Views: 320
Reputation: 73984
You are not uploading a picture, you are sharing an URL with a picture. It should follow best practices and you cannot control how exactly it will be cropped for viewing by Facebook: https://developers.facebook.com/docs/sharing/best-practices#images
Better: Use correct Open Graph tags in the source of the shared URL instead.
If you want to upload a picture, use the /photos endpoint instead.
Upvotes: 1