Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Bugfix - Facebook user images lose aspect ratio due to incorrect API call

edited November 2015 in Vanilla 2.0 - 2.8

As you can see in my profile picture right now, Facebook avatars get distorted when you post, so everyone's face is squishy.

This is because the API call currently being used to get the user image is:


This returns a rectangular image which is then squished into a square thumbnail on our end, ruining the aspect ratio.

The behavior of type=large is to yield a rectangular image in which the longest dimension is 200px. If what we really want is a square 200x200 image, a slightly different API call will yield that result:


This fixes the problem perfectly and yields the desired behavior. For instance, using my profile picture as an example and resizing to square:



To make the change on Vanilla 2.2 stable, go to class.facebook.plugin.php and change the following lines

Line 340: 'Photo' => "//{$Profile['id']}/picture?type=large"
Line 531: $Form->setFormValue('Photo', "//{$ID}/picture?type=large");



Sign In or Register to comment.