39 pointsStarting to get into this DEV thingI'm new here
wpkitchen
Member
—
14th December 2011
The Avatars plugin forces a square Crop Ratio.
this is determined by line 384 in the file avatars.php that reads:
ratioDim: { x: 128, y: 128 },
There is no settings that allow you to change this from the admin, and as the values are hardcoded and without a filter, there is no way to prgramatically change it without hacking the plug-in files.
I would very much like to suggest, if the author could add:
A filter for this ratio and make it honor the dimensions set in the media settings for thumbnails as a starting point.
This would greatly enhance the waz this plug-in integrates with wordPress as a whole.
this is determined by line 384 in the file avatars.php that reads:
ratioDim: { x: 128, y: 128 },
There is no settings that allow you to change this from the admin, and as the values are hardcoded and without a filter, there is no way to prgramatically change it without hacking the plug-in files.
I would very much like to suggest, if the author could add:
A filter for this ratio and make it honor the dimensions set in the media settings for thumbnails as a starting point.
This would greatly enhance the waz this plug-in integrates with wordPress as a whole.
ok, so I see it's more complicated, because although changing those values will make the javascript cropping tool apply a corresponding ratio, the file will still be scaled to a square ratio. This means that cropping it to a ratio of 2:1 will result in an wide image that is pressed together to a square, giving a distorted image.
I need help from the plug-in author on how to change the last part of the process to honor the ratio set by the cropping tool.
ok i found ut how to do that, but also that the avatar handling build in to WordPress together with the get_avatar() function isn't actually build to handle non square avatars out of the box.. I'll close this thread, and try to make my own workaround by hooking into get_avatar filter.
Responses (3)
Member — 14th December 2011 #
ok, so I see it's more complicated, because although changing those values will make the javascript cropping tool apply a corresponding ratio, the file will still be scaled to a square ratio. This means that cropping it to a ratio of 2:1 will result in an wide image that is pressed together to a square, giving a distorted image.
I need help from the plug-in author on how to change the last part of the process to honor the ratio set by the cropping tool.
Member — 14th December 2011 #
ok i found ut how to do that, but also that the avatar handling build in to WordPress together with the get_avatar() function isn't actually build to handle non square avatars out of the box.. I'll close this thread, and try to make my own workaround by hooking into get_avatar filter.
WPMU DEV Fanatic — 15th December 2011 #
Hi wpkitchen,
Glad you got that initial part sorted, but yeah, other than square dimensions would require some extra work as far as I can see.
-David
Become a member