I cannot recall the image handling system we used before Avatar Crop, but we had set it to name the user profile pics in the username.jpg format. Avatar Crop has been awesome in allowing our users to upload their own pics but still maintain our standard 160x220 pixel size. Unfortunately Avatar Crop names pics as 'picture-#####.jpg' format.
To achieve our 'username.jpg' format, I've altered this code in .module at about line 141:
$uID = $_SESSION['change_pic_uid'];
$account = user_load($uID);
//$dest = variable_get('user_picture_path', 'pictures') .'/picture-'. $owner .'.'. $extension;
$dest = variable_get('user_picture_path', 'pictures') .'/'. $account->name .'.'. $extension;
And I've commented out this code in .module at about line 254:
/*$dot = strrpos($src, '.');
if (!($dot === false)) {
$newsrc = substr($src, 0, $dot) . rand() . substr($src, $dot);
if (rename($src, $newsrc))
{
$src = $newsrc;
}
} */
It would be a nice feature to allow users to configure the file naming format.
Thanks for this module, it has enabled us to maintain the profile pic sizes but offload the work from developers.
Comments
Comment #1
gregglesfor what it's worth, I'm not a big fan of this feature. What if someone changes their username?
If I were the module maintainer I would mark this as "won't fix."
Comment #2
avpadernoI am closing this issue, as it has been created for a release that is now not supported.