Keyword

Facebook Like - Blank image

  • Matt Medley
  • Matt Medley's Avatar Topic Author
  • Offline
  • Junior Member
More
9 years 3 months ago - 9 years 3 months ago #140272 by Matt Medley
Facebook Like - Blank image was created by Matt Medley
I'm trying to fix an issue for a client's blog. They don't use the image tab (we've imported a ton of articles from Joomla and is not an option to go through and change all). When sharing on Facebook there's a problem with the og:image.

I searched and searched and found some solutions to this. It's sort of working, the og:image is showing in the facebook debugger, however it's transparent, or white. Seems sort of that images/system/blank.gif is over it or something.

I've tried adding this to the top of my item.php which works at finding the og:image in the content

$document =& JFactory::getDocument();
preg_match('/<img [^>]*src=["|\']([^"|\']+)/i', $this->item->fulltext, $arrImages);
if (!empty($arrImages[0])){
	$image = JURI::base().$arrImages[1];
	$openGraphImage = '<meta property="og:image" content="'.JURI::base().$arrImages[1].'"/>';
	$document->addCustomTag($openGraphImage);
}

I've also tried this which also works:
<?php if( !empty($this->item->image) ): ?>
<script type="text/javascript">(function($) {$(document).ready(function() {
   $('head').append('<meta property="og:image" content="<?php echo $_SERVER['HTTP_HOST'] . $this->item->image; ?>" />');
});})(jQuery)</script>
<?php endif; ?>

If I right click and view the image that's in the share box (the url is correct), but when I click view image it shows me a tiny blank image, page info says it's safe_image.php

Any information you can share would be greatly appreciated.
Last edit: 9 years 3 months ago by Matt Medley.

Please Log in or Create an account to join the conversation.

More
9 years 3 months ago #140312 by Lefteris
Replied by Lefteris on topic Facebook Like - Blank image
Hi,

Is there a link to the page? Facebook is caching those requests, so you might need to test your code with a new item.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

  • Matt Medley
  • Matt Medley's Avatar Topic Author
  • Offline
  • Junior Member
More
9 years 3 months ago #140326 by Matt Medley
Replied by Matt Medley on topic Facebook Like - Blank image
I keep on trying new items but same results. Here's a link to one of the posts - juliedaniluk.com/food-facts/spice-up-your-life-with-ginger.html

Please Log in or Create an account to join the conversation.

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
9 years 3 months ago #140356 by Krikor Boghossian
Replied by Krikor Boghossian on topic Facebook Like - Blank image
It seems to be working now Matt. I clicked like and the image was correct.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

  • Matt Medley
  • Matt Medley's Avatar Topic Author
  • Offline
  • Junior Member
More
9 years 3 months ago #140409 by Matt Medley
Replied by Matt Medley on topic Facebook Like - Blank image
Thank you for helping Krikor. This is so strange. That one does seem to be working now. But have tried other postings on the site and still get blank images.

fbexternal-a.akamaihd.net/safe_image.php?d=AQA8SsogdV4s1B6e&w=158&h=158&url=https%3A%2F%2Fjuliedaniluk.com%2Fimages%2FBuffet+Table+Favourite+2.jpg&cfs=1&upscale=1

I have used Facebook debugger to scrape new information but still... safe_image.php... why oh why???

Please Log in or Create an account to join the conversation.

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
9 years 3 months ago #140415 by Krikor Boghossian
Replied by Krikor Boghossian on topic Facebook Like - Blank image

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

  • Matt Medley
  • Matt Medley's Avatar Topic Author
  • Offline
  • Junior Member
More
9 years 3 months ago #140428 by Matt Medley
Replied by Matt Medley on topic Facebook Like - Blank image
I used IAKI - Import As K2 Image originally. But that was a while ago. These are new articles, just made normally with the images inline.

Please Log in or Create an account to join the conversation.

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
9 years 3 months ago #140471 by Krikor Boghossian
Replied by Krikor Boghossian on topic Facebook Like - Blank image
These items have not regenerated K2's images. This means that items bellow 200px in each dimensions are not suitable for Facebook.

This means practically that the issue lies with these specific items. Once you replace the image, the og tags will work fine.

Hint: Since Facebook caches the content of your site, you might have to wait some time in order to see any results.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

  • Matt Medley
  • Matt Medley's Avatar Topic Author
  • Offline
  • Junior Member
More
9 years 3 months ago - 9 years 3 months ago #140480 by Matt Medley
Replied by Matt Medley on topic Facebook Like - Blank image
Thank you for your continued assistance.

The image for each article is almost always at least 400px in width. Never less that 200px. And when I scrape the articles with facebook debugger even small icons show fine, just not the first image in the post. It appears, but is blank and the link for the image has fbexternal-a.akamaihd.net/safe_image.php?d= in it....

So that can't be the issue. Any other suggestions?
Last edit: 9 years 3 months ago by Matt Medley.

Please Log in or Create an account to join the conversation.

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
9 years 3 months ago #140501 by Krikor Boghossian
Replied by Krikor Boghossian on topic Facebook Like - Blank image

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum