Problem/Motivation

Facebook is loading images referred in og:image within the share dialog only upon opening the share dialog a second time. And it's apparently not a Drupal/Sharemessage related problem: http://stackoverflow.com/questions/27913369/facebook-open-graph-no-image...

Proposed resolution

Determine width and height of the image by using getimagesize() and add corresponding meta tags if possible.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

s_leu created an issue. See original summary.

s_leu’s picture

Status: Active » Needs review
FileSize
1.81 KB

Here's a patch that adds a new global setting and provides og:image:width and og:image:height if the setting is enabled.

s_leu’s picture

Fixed usage of wrong function for fetching image meta data.

Berdir’s picture

Status: Needs review » Needs work

As discussed, works as a quick fix, but I'd prefer a solution that offers and prefers tokens for this, so that e.g. https://www.drupal.org/project/imagecache_actions could be used.

Berdir’s picture

Berdir’s picture

Version: 7.x-1.x-dev » 8.x-1.x-dev
Status: Needs work » Needs review
FileSize
5.64 KB

New patch for D8, using separate fields and tokens.

Berdir’s picture

And now with tests for both the image size properties and the fallback image.

Berdir’s picture

Status: Needs review » Fixed

Committed. Marking as fixed, no plans to backport to 7.x-1.x at the moment.

  • Berdir committed d239b4a on 8.x-1.x
    Issue #2673242 by s_leu, Berdir: Add option that enables rendering og:...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.