Hello,

I enabled Open Graph Meta tags on the website I'm currently developping. It's been working fine so far, while I was testing with small test images.

But I just noticed there seems to be an issue when the image I'm putting in the meta tag "og:image" is very large. I'm talking about 5MB images. When that happens , even if the image url is right (and correctly interpreted by Facebook URL Linter), the thumbnail does not get generated when sharing the link on Facebook.

I guess it should not be difficult to make a fix for that, but I did not get any chance to look at the code for the moment. The best way to to this would be to add the possibility to select an image cache preset to generate the placed in the og:image tag, if imagecache is installed. That would let the website generate a smaller file, then Facebook would be able to generate its own thumbnail after.

I'm ready to help in any way I can.

Comments

tararowell’s picture

I am having the same issue - or at least I think I am! The og:image is set correctly, but FB regularly chooses a different thumbnail.

Have you been able to pinpoint this issue to a certain threshold? You mentioned 5MB, but I am finding this when an image is much smaller, like 85kb.

lanouettea’s picture

No, 85kB is far less than what the limit should be.

I see that comportment only with large image.

You can try the URL linter tool of Facebook. It will tell you if there is any trouble at the url provided: http://developers.facebook.com/tools/lint/

Simply enter the URL of your page and it should tell what it sees as an image, subject, description, etc as well as any missing or incorrectly built tags.

My issue seems to be different than yours. The url Facebook sees as the image for the page is the right one. It is the URL to the image attached to the node. Thing is, it doesn't generate its thumbnail and only displays a blank square. When I click that square, it correctly links to the image. On smallerimages attached to other nodes of the website, the thumbnail gets generated correctly. This is why I'm guessing it is tied to the image size.

A simple solution would be to link to an imagecache generated thumbnail in the og:image tag, which would make sure Facebook is able to generate its own after. But I'm afraid I don't have time to work on this at the moment, and I never took time to look at the code of this module yet.

lanouettea’s picture

Any help with this?

pribeh’s picture

I'm experiencing this as well. Subscribe.

seakayjay’s picture

I had the same issue. It seems to me that if the image is too large, facebook may not render it. So what I did is created a smaller size preset in imagecache and set the og:image value to imagecache images instead.

Paste the code below in node.tpl.php
<?php drupal_set_html_head('<meta property="og:image" content="'.imagecache_create_url('preset_name', $field_image[0]['filepath']).'" />'); ?>

If you have multiple image values,

<?php foreach ($node->field_image as $image) { ?>
  <?php drupal_set_html_head('<meta property="og:image" content="'.imagecache_create_url('preset_name', $image['filepath']).'" />'); ?>
<?php }; ?>

Hope this helps.

circuscowboy’s picture

Status: Active » Closed (duplicate)

working on a patch to add imagecache to the og:image which will most likely solve this problem.

http://drupal.org/node/1181104

cneumann’s picture

Am I forced to use OG? When I install it, it causes a raft of errors.