In opengraph_meta.common.inc line 558 the default image style "thumbnail" is declared:
if (is_array($fields)) {
if (!empty($fields['filemime']) && FALSE !== stripos($fields['filemime'], 'image') && !empty($fields[$_uri_field])) {
$url = $fields[$_uri_field];
if (7 <= OPENGRAPH_META_DRUPAL_VERSION)
$url = image_style_url('thumbnail', $fields[$_uri_field]);
In most installations the thumbnail image preset generates images of 100 x 100px. Facebook, however, requires images of minimum 200 x 200px as the object debugger explains:
Tiny og:image: All the images referenced by og:image must be at least 200px in both dimensions. Please check all the images with tag og:image in the given url and ensure that it meets the minimum specification.
So when you for instance like a post, no image is simply displayed, therefore consider enabling custom preset settings or another hardcoded preset.
Comments
Comment #1
q2_faith CreditAttribution: q2_faith commentedI think this module must made own preset 200x200
Comment #2
nlisgo CreditAttribution: nlisgo commentedAs an interim I suggest that we allow users to select their own default image style for the og:image tag.
See attached patch. Facebook does indeed give a warning that images should not be less than 200px in height and width but even with a module specific image style that would achieve that it is better to allow users to select which image style default they want for the og:image enabling them to present the image as they want.
Comment #3
nlisgo CreditAttribution: nlisgo commentedComment #4
chlarkkirby CreditAttribution: chlarkkirby commentedany updates on this?
Comment #5
Erik Seifert CreditAttribution: Erik Seifert commentedSmall Fix:
Now you can set your style in settings.php
So you have a simple configuration
Comment #6
ataxia CreditAttribution: ataxia commentedThank you so much, erikseifert! Although I VERY RARELY will hack a contributed module, I used the fix in #5 and it resolved everything.
The thumbnail size for images on the site I'm working on are very small, but they are used throughout the site, so changing the thumbnail to a larger size broke a lot of other layouts.
This Facebook developer page was very helpful in being able to see what was going on: https://developers.facebook.com/tools/debug
After you paste a URL on that page, look at the Open Graph Warnings that Should Be Fixed section:
In the Raw Open Graph Document Information section, you can see which image was deemed 'too small':
I think 1500x1500 is crazy huge, so I used a 620px width image format size and that works fine.
- ataxia
Comment #7
Erik Seifert CreditAttribution: Erik Seifert commentedWithout hacking hook_html_head_alter is your friend:
http://api.drupal.org/api/drupal/modules!system!system.api.php/function/...
Comment #7.0
Erik Seifert CreditAttribution: Erik Seifert commented.
Comment #8
markkus69 CreditAttribution: markkus69 commentedSame issue. Help?
Comment #9
gnugetis this still an issue?
I can't even find that code in the 7.x-1.4 version.
And seems to metatag doesn't apply a preset anymore in the image.
Comment #10
caspervoogt CreditAttribution: caspervoogt at Plethora commentedYes this is still an issue. I was using 7.x-1.3 and then switched to 7.x.-1.x-dev, and both were affected. I applied the patch, which solved it for me. I am unaware of a 7.x.-1.4 release though.
Comment #11
gnugethahaha, sorry I was looking in the wrong module. Ignore #9 please :-p
Comment #12
torotil CreditAttribution: torotil commentedI've just committed a fix that changes the behavior to always link the "original" image. This should fix the immediate issue with the 100x100 thumbnail image-style. I think there is a feature request for making the image-style configurable.
Comment #15
tamer.kamel CreditAttribution: tamer.kamel commentedThere is a small change you can replace the thumbnail by the orginial image you uploaded.
Comment #16
AntiNSA CreditAttribution: AntiNSA commentedWith the different patch verssions, can someone point me which patch is still effective for d6 version? Can you roll this into a d6 patch? Thanks!
Comment #17
a.milkovsky#12 does not fix the issue. Image is still a thumbnail.
#15 fixes the issue.
#16 please open a new issue for d6
I improved #15 to store relative path. It is good for different environments.
Path is converted to absolute at render process. @see OpenGraphMeta::render_data()
Please review.
Comment #18
caspervoogt CreditAttribution: caspervoogt at Plethora commentedThe following lines in opengraph_meta.common.inc cause '404 not found' images in our multilingual Drupal site;
... because the images wind up with the language code in the URL, which is an invalid path. E.g. http://www.somesite.com/en/sites/default/files/myimage.png rather than http://www.somesite.com/sites/default/files/myimage.png
I have for now changed this to;
This works for us.
Comment #19
sarathkm#5 is a quick fix for D7.
Comment #20
arnoldbird CreditAttribution: arnoldbird commentedre: #5, the variable name should incorporate the module's machine name, like so...
$style_name = variable_get('opengraph_meta_image_style', 'thumbnail');
$url = image_style_url($style_name, $fields[$_uri_field]);
UPDATE: The latest dev code uses a variable name that incorporates the module machine name:
http://cgit.drupalcode.org/opengraph_meta/commit/?id=3dcff6d64e1568d8684...
Comment #21
aludescher CreditAttribution: aludescher at drunomics commentedRewrite of #17 with proper file paths.
Comment #22
torotil CreditAttribution: torotil commentedI’m about to drop support for 7.x-1.x (or 7.x-1.3 specifically). Is anyone willing to step up as a maintainer of the 7.x-1.x branch?