Support » Plugin: User Avatar » [Plugin: User Avatar] avatar size

  • what i dont like about this plugin is, if you want to have another picture size as 150px you have to hack yourself throught the plugin. this is a very easy step, but when it comes to updates, you have to hack it again.

    best practice would be, to let the user edit the size in an input field and save that data in the db, so when there is an update, these changes wont get lost.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Contributor Enej Bajgorić


    Hi jnz31, thanks for your feedback.

    The plugin should be automatically resizing the pictures to particular sizes defined in the theme, just like gravitar.
    I wanted this plugin to work without having to save any settings. So some configurations is available by defining it in the code.

    To do that you have
    You should be able to place

    define( 'USER_AVATAR_FULL_WIDTH', 150 );
    define( 'USER_AVATAR_FULL_HEIGHT', 150 );

    into your wp-config.php file and user avatar will pick it up.
    And if you update the plugin it should stay as your defined values.

    I hope my answer make sense.

    Thread Starter jnz31


    quel, thx for the quick reply.
    will see if this works with the next update 😉


    Plugin Contributor Enej Bajgorić


    Let me know if it doesn’t 🙂

    I tried that, and it didn’t work for me. I even took out the relevant “define” lines from your plugin, and that didn’t make a difference. For that matter, before that, I edited those lines in your plugin to have different sizes (both the thumbnail and the full size settings), and nothing seemed to change. Actually, that’s not totally true–on the crop page, it shows my image size under “Choose the part of the image you want to use as your profile image.” and under the preview, but then when I click “Crop, it warps the image and creates a 150 x 150 version.

    Can you help? I’m boggled and frustrated. Thanks!

    Thread Starter jnz31


    the size is defined in file user-avatar.php
    in line 80 – 90 is the specific code.

    if ( !defined( 'USER_AVATAR_THUMB_WIDTH' ) )
    	define( 'USER_AVATAR_THUMB_WIDTH', 50 );
    if ( !defined( 'USER_AVATAR_THUMB_HEIGHT' ) )
    	define( 'USER_AVATAR_THUMB_HEIGHT', 50 );
    if ( !defined( 'USER_AVATAR_FULL_WIDTH' ) )
    	define( 'USER_AVATAR_FULL_WIDTH', 260 );
    if ( !defined( 'USER_AVATAR_FULL_HEIGHT' ) )
    	define( 'USER_AVATAR_FULL_HEIGHT', 260 );

    its already modded to my needs, 260px. works like a charme.

    BUT they only are generated, when you upload a new image, not when you update the settings.

    OK, as I mentioned, I had already tried editing those lines to no avail, but I’ll go through it once again. Meanwhile, if anyone has an idea why that wouldn’t work for some reason, please let me know.
    Thanks again!

    I just went and deleted the plugin, reinstalled it, and went directly to change those values. I changed both the thumb and full size values to 100 width and 125 height.

    Just as before, those new dimensions seem to be reflected in the page where it asks you to choose the crop area to use, but once I click “Crop”, the resulting image is 150 x 150, and distorted (since the original image is not 150 px wide).

    Any help figuring out why this would for some reason not work as described would be much appreciated. Is there somewhere else where this might be being overridden? It’s not in my wp-config.php, and I did a search through my theme’s files for USER_AVATAR and nothing came up.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘[Plugin: User Avatar] avatar size’ is closed to new replies.