When using the Facebook auto-imported avatar in Drupal profiles, the avatar does not scale, crop, or otherwise shrink to comply with the setting in the Administer -> User Management -> User Settings -> Picture Maximum Dimensions. This means that all users with standard pictures may have one size avatar, while all facebook connect users are inadvertently allowed to have larger avatars. This plays havoc with theming, not to mention ego's.

Comments

tsi’s picture

True, subscribing

LaNets’s picture

Assigned: Unassigned » LaNets
Status: Active » Fixed
tsi’s picture

Status: Fixed » Needs work

I think now it is worse because the images are getting cropped instead of being scaled.
I now have a user that got her head cut out of the picture.

tsi’s picture

Status: Needs work » Needs review

I changed line 482 to :
image_scale($file, $dest, $width, $height);
and I think its working better now.

Gekiboy’s picture

StatusFileSize
new1.57 KB

There's still an issue where the module will try to upscale the images if the profile picture dimensions are larger than the image retrieved from facebook. I've put together a patch to fix this issue. Please review and let me know what you think.

Gekiboy’s picture

Assigned: LaNets » Gekiboy
Gekiboy’s picture

StatusFileSize
new1.57 KB

I've updated my patch to work with the latest snapshot.

hankpalan.com’s picture

Which profile picture is it pulling from Facebook. The one on my profile page is 200px wide, but I think its pulling the 50x50 cropped and scaled picture used for all the comments. Is there anyway to have it pull the larger picture and since I'm using imagecache to scale my profile pics it would all work perfectly.

Or is there no option with the FB API to grab a different profile pic?

hankpalan.com’s picture

480    // Resizing
481    list($width, $height) = sscanf(variable_get('user_picture_dimensions', '85x85'), '%dx%d');
482    image_scale_and_crop($file, $dest, $width, $height);

Is this code taking the profile picture from Facebook and resizing and cropping it to 85x85?

If it is, then pardon the question, but who thought hard coding that was a good idea? Use Imagecache and Imagecache profile people. Easy to install and setup and will get rid of a lot of headache. Not everybody wants the picture resized and cropped especially to 85x85.

If that's not what its doing then sorry for the rant.

arcane’s picture

The code above gets the user picture dimensions from whatever you have set in the variable. If no variable exists, it defaults to 85x85.

rburgundy’s picture

subscribing

hexen’s picture

Version: 6.x-1.0-beta7 » 6.x-1.0-beta9

subscribing...

vectoroc’s picture

Nowadays patch is not actual. Pictures is displayed directly from facebook

vectoroc’s picture

Status: Needs review » Closed (works as designed)
vintageb’s picture

Sorry, a noobie here, where do I put this code to change the FB picture size?

ensignavenger’s picture

Could this be made compatible with ImageCache Profiles module? I'm pretty new to developing, but I'm looking into doing this. I need it to work for a site I am building. If anyone has ideas, please let me know.

vectoroc’s picture