guardian/frontend — pull request #7280 by JustinPinner (2014-11-25 13:59:05+00:00)
Title: Facebook share should use trail picture if possible (with switch)

This branch originally set out to consider using the article thumbnail for the opengraph image, but after talking to Chris Mulholland it switched over to preferring the trail picture instead.

Some articles (in this case the flying dogs gallery http://www.theguardian.com/lifeandstyle/gallery/2014/nov/24/flying-dogs-in-pictures) may feature a large main image that is in portrait format and the automatic crop applied by Facebook does a really bad job with those.

Now, if the `FacebookShareUseTrailPicFirstSwitch` is switched on, we'll try to find the largest trail picture available instead, as these are usually in a landscape orientation and auto-cropping works better with those.

If no trail picture is available (unlikely) it'll revert to its original fallback mode for the context it is running in.

The switch is there primarily to cope with the event of something going pear-shaped or some unforeseen side-effect causing problems. Or someone just changing their minds again later.