Skip to:
Content
Pages
Categories
Search
Top
Bottom

Uploaded Avatar Quality

  • @inhouse

    Member

    I set the full size of all new avatars to 650×250 via bp-custom.php and the crop tool works great Only problem is the image appears pixilated after cropping. Doesn’t seem to matter if the image was created exactly to size at 72 dpi or if the uploaded image was much larger. Is there a quality setting somewhere I can edit? I double checked and the image isn’t being re-sized via CSS or anything like that. I don’t see anything jumping out at me in bp-core-avatars.php to modify either. Any idea on this?

Viewing 9 replies - 1 through 9 (of 9 total)
  • @inhouse

    Member

    A little more information:
    Image before upload: 139 KB
    Image after upload: 41KB

    There’s something wrong with a reduction of this magnitude when the image was pre-cropped to the exact size it needed to be before upload. I still can’t find any information on this.

    @shanebp

    Moderator

    >I set the full size of all new avatars to 650×250
    That’s huge.

    What image type are you testing with? I’m guessing jpg

    Try a png – won’t solve your problem but might narrow it down.
    And make it bigger than your default size

    also – post your bp-custom code for this.

    @djpaul

    Keymaster

    I believe this is affected by a setting in WordPress that creates JPGs at 90% quality compression; try https://wordpress.org/extend/plugins/jpg-image-qualitycompression/

    @inhouse

    Member

    Thanks for replying @shanebp and @djpaul. I tried the JPG Image Quality plugin but that made no difference. The image compression is way less than 90% of the original image quality. I set it to 100 and the image looks the same. I’m uploading JPGs at various sizes. As I’ve said, I have pre-cropped to the exact size at 72 and 300 dpi with no success. I’ve also tried using uncropped images that are 3000px wide. Here’s my bp-custom.php code as requested:

    `// Modify Avatar Sizes
    define ( ‘BP_AVATAR_THUMB_WIDTH’, 130 );
    define ( ‘BP_AVATAR_THUMB_HEIGHT’, 50 );
    define ( ‘BP_AVATAR_FULL_WIDTH’, 650 );
    define ( ‘BP_AVATAR_FULL_HEIGHT’, 250 );`

    I’m calling the full size in my profile-loop file. I verified that the images are indeed 650×250 at 72 dpi but the file size is being reduced by the uploading/cropping. Thanks again for any help.

    @shanebp

    Moderator

    Avatars are usually square.
    The cropping tool only does squares – at least on all my installs.

    Try defining a square size and check the quality.

    Try a png to check quality.

    If you want rectangular avatars, you’ll probably need to make changes to core files.

    @inhouse

    Member

    @shanebp, the crop tool produces any aspect ratio you choose. With my bp-custom modifications, the crop tool produces 650x250px images just fine with the exception of the image quality. Something is reducing the quality. I thought @djpaul was on to something and might still be, but his suggestion didn’t fix it.

    @inhouse

    Member

    Ok, this is solved as far as I can tell. Line 35 of bp-core-avatars.php has been updated. Specifying the max file size seems to have fixed this.

    from:
    `define( ‘BP_AVATAR_ORIGINAL_MAX_FILESIZE’, 5120000 );`

    to:
    `define( ‘BP_AVATAR_ORIGINAL_MAX_FILESIZE’, 5120000*5120000 );`

    I don’t really know why this was necessary but it fixed the issue. If anyone who is more knowledgable than me can explain this to me or maybe someone else who finds this thread, that’d be great. If not, maybe they find the answer and that’s enough. I don’t know if this is a bug or not either. Thanks!

    @shanebp

    Moderator

    Congrats on fixing the issue – although what you did makes no sense to me.
    It would seem that your users can now upload 25 MB avatars.

    Post your bp-custom code re full-size and crop tool.

    Did you ever try a png ?
    That would let you know if it’s a compression issue or something else.

    My complete guess is that the images are being downsized prior to cropping and then expanded to your dims which is causing pixelation.

    @inhouse

    Member

    @shanebp No, that’s not it because the images looked great after uploading and prior to cropping. It was only after the page reloaded after cropping that they looked pixilated. And as I said earlier, I verified that the images after cropping were 650×250. And also, I’d still be having the issue if your guess was correct. I can’t explain why this worked but it did the trick. The server limits would take care of images too large anyways.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Uploaded Avatar Quality’ is closed to new replies.
Skip to toolbar