Topic-icon Image size in FB social stream

Active Subscriptions:

None
8 years 2 months ago #56945 by marbur
I've just successfully set up a SCSocial Stream module for my Facebook page and I'm working on getting the output formatted to meet my needs. Everything has gone great except that the many of images from the Facebook posts are coming in smaller than I want. How do make the Social Stream display the image from the post in the same size that Facebook does (or just give it to me full size and I'll control sizing myself).

Thanks.
The topic has been locked.
Support Specialist
8 years 2 months ago #56958 by mel
Replied by mel on topic Image size in FB social stream
We would recommend creating your own theme for the SCSocialStream to control the sizing of the image. To do this, follow our instructions in the Theming section. In this case, you should focus on the styles.css file and possibly the facebook.php file.
The topic has been locked.
Active Subscriptions:

None
8 years 2 months ago #56972 by marbur
I've actually already done work on styles.css and facebook.php to get things formatted how I need. At this point everything is good except for the image size issue. Unfortunately there isn't anything I can do about the image size in either styles.css or facebook.php because the image is already reduced to 130x130 by the time these file can act on it.

Here's a sample of the html for one of the images with the size parameter in red:

img src="scontent.xx.fbcdn.net/hphotos-xla1/v/t1.0-0/s130x130/12670444_10153872073763560_5749320262730785906_n.jpg?oh=c901dc2a2438974f6f65d1f0e7c07a1f&oe=572CDE57"

I don't know where that size is being set but I need to get to the full size image from the post (which being displayed as 470px x 234 px on Facebook and the actual image is 960px x 720px). I'm wondering of the problem is that I need to use a different field in facebook.php instead of $this->thumbPicture. If this is the case, what is the field reference I should be using to get the full size image?

Thanks!
The topic has been locked.
Support Specialist
8 years 2 months ago #56979 by alzander
JFBConnect fetches all of the Post objects from a feed. You can see all the parameters that are returned on the page below:
developers.facebook.com/docs/graph-api/reference/v2.5/post
While we rename the 'picture' field to thumbPicture, we're returning the only image value that Facebook returns. They automatically resize and cache images on their end however they feel is optimal. We don't have any control over the size of the image that is stored on their server or returned for the feed.

I hope that helps explain a bit, but I'm sure it's not what you were looking to hear.

Thanks,
Alex
The topic has been locked.
Active Subscriptions:

None
8 years 2 months ago #56982 by marbur
Thanks for the reply. As I've done more research I was afraid that this would be the answer.

There is another field returned defined as:

object_id: The ID of any uploaded photo or video attached to the post.

Is there any way with JFBConnect to get the actual uploaded photo using the object_id?
The topic has been locked.
Support Specialist
8 years 2 months ago #56989 by alzander
The picture field gets an image that's been scraped from any links in the post. That means it's using the Open Graph tag from whatever page has been linked to.

The object parameter you're looking for is different. That's for news feed posts that have an image uploaded directly into the post. It'd likely be easy to update and get the object id from the post. However, then, you'd need to do another request to get information about that object and then parse out the response (could be a URL to a video or picture as well as various other bits of information. I don't know the format of that object edge off-hand, so don't know how difficult it would be to parse. The additional requests, per post in the feed, would cause a delay in the fetch of the feed though.

Let me know if what you're trying to work with is an image inside the post or the image that's coming from a link in the post. If it's the latter, that's what we already support, and there's no method to get a larger version of that image.

I hope that helps,
Alex
The topic has been locked.
Active Subscriptions:

None
8 years 2 months ago #57012 by marbur
It's the images inside the post that I'm needing to have formatted differently, not the image from links in posts.
The topic has been locked.
Support Specialist
8 years 2 months ago #57017 by alzander
Can you provide a link to a page where we can see the feed and the incorrect image so that we can understand things a bit more? Also, please post the Page's URL so we can see the actual feed within Facebook.

Thanks,
Alex
The topic has been locked.
Active Subscriptions:

None
8 years 2 months ago #57023 by marbur
The Joomla page is: biz186.inmotionhosting.com/~valhal21/index.php
The Facebook feed is in the center under the header: Recent News

The FB page is: www.facebook.com/ValhallasGate/

In particular you might look at the two posts from January 29.

Thank you.
The topic has been locked.
Support Specialist
8 years 2 months ago #57027 by alzander
Alright.. did some more research and found an undocumented parameter that can be used to get a larger image from the post. To try, please edit the /components/com_jfbconnect/libraries/provider/facebook/channel/page.php file.

Around line 92, you'll see:
$feed = $this->provider->api($pageId . '/feed?fields=message,from,updated_time,name,link,picture,caption,description,comments', $params, true, 'GET');
Update that list with full_picture, like:
$feed = $this->provider->api($pageId . '/feed?fields=message,from,updated_time,name,link,picture,caption,description,comments,full_picture', $params, true, 'GET');

Then, on line 121, update:
$post->thumbPicture = (array_key_exists('picture', $data)?$data['picture']:"");
To:
$post->thumbPicture = (array_key_exists('picture', $data)?$data['full_picture']:"");
Let us know how that works. I can't find any information on that parameter, so not sure we'd use it in a release (it may break anytime), but we'll see what we can do. You're feedback would be very helpful.

After you do that, clear your caches in Joomla to get the latest feed!

Thanks!
Alex
The topic has been locked.