Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#7 | sharemessage-height-width-2673242-7.patch | 10.7 KB | Berdir |
| |||
#6 | sharemessage-height-width-2673242-6.patch | 5.64 KB | Berdir |
#3 | extended-og-image-tags_2673242_3.patch | 1.8 KB | s_leu |
| |||
#3 | extended-og-image-tags_2673242_3.interdiff.txt | 622 bytes | s_leu |
#2 | extended-og-image-tags_2673242_2.patch | 1.81 KB | s_leu |
|
Comments
Comment #2
s_leu CreditAttribution: s_leu at MD Systems GmbH commentedHere's a patch that adds a new global setting and provides og:image:width and og:image:height if the setting is enabled.
Comment #3
s_leu CreditAttribution: s_leu at MD Systems GmbH commentedFixed usage of wrong function for fetching image meta data.
Comment #4
BerdirAs 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.
Comment #5
BerdirI meant https://www.drupal.org/project/imagecache_token of course.
Comment #6
BerdirNew patch for D8, using separate fields and tokens.
Comment #7
BerdirAnd now with tests for both the image size properties and the fallback image.
Comment #8
BerdirCommitted. Marking as fixed, no plans to backport to 7.x-1.x at the moment.