How to avatar auto resize on upload?

@halilesen · 10 Apr 2024 · 17618 views
Post Reply
User avatar
halilesen
#1 ·
Posts: 66
Joined: 24 Mar 2024, 18:09
Full Name: Halil ESEN
Has liked: 19
Been liked: 17
phpbb-auto-resize-avatar-phpbb-avatar-resize-phpbbgroup.jpg
phpbb-auto-resize-avatar-phpbb-avatar-resize-phpbbgroup.jpg (108.47 KiB) Viewed 17590 times

It is extremely important that the avatars uploaded by users in your phpBB forum automatically transform to the size you specify. This is because not every user may want to deal with resizing their avatar, or profile picture. However, resizing the avatar during upload makes it easier for both parties. Here I will explain how you can automatically resize avatars to be uploaded to your phpBB board.

Although automatic avatar resizing is rumored to be coming in a future release, phpBB does not yet have it by default. But you can add this feature by installing a very lightweight extension. Developed by user Ger at phpBB.com, this extension resizes uploaded avatars that exceed allowed dimensions to those maximum settings.

Let's go step by step. First, download the extension that I have made ready for installation.

avatarresize.zip
(10 KiB) Downloaded 572 times

Install and export the extension in the /ext folder in the phpBB root. Then go to ACP and enable the extension in Customize tab > Extensions Manager. Have installed the extension, now let's check the Avatar settings.

Go to General tab > Board configuration menu > Avatar settings. First, make sure "Enable avatars: Yes". Then look at the maximum avatar dimensions and minimum avatar dimensions options right below.

The extension will resize avatars according to the maximum avatar dimensions option, but I usually set the minimem option the same way.

phpbb-avatar-resize-auto-avatar-size-phpbb_group.jpg
phpbb-avatar-resize-auto-avatar-size-phpbb_group.jpg (20.07 KiB) Viewed 17618 times

This is a personal preference, if you want to accept avatars smaller than the maximum size, enter a value to suit your preference. Whatever happens, make sure all inputs are full. In the past I have gotten various errors when I left some of them empty.

Finally, set the "maximum avatar file size" option to 0, just in case. Sumit.

This way, the avatars uploaded to your phpBB dashboard will automatically be adjusted to the size you specify.

If you want, you can delete the following line from your style's ucp_avatar_options.html file, which gives min and max avatar size information in UCP later.

Code: Select all

<dt><label>{L_CURRENT_IMAGE}{L_COLON}</label><br /><span>{L_AVATAR_EXPLAIN}</span></dt>
But you may need to redo it from style updates. Another option is to edit the language files.

Share your thoughts. Do you use automatic avatar resizing? Were you able to complete the installation without any errors by following the post?
BordLord
#2 ·
Posts: 4
Joined: 15 Feb 2025, 00:57
Full Name: Rick White
Been liked: 1

Re: How to avatar auto resize on upload?

I just installed this on my board in the same directory as my other extensions but it's not showing up in the extension management section. I'm currently using version 3.3.14 and the readme file says I need at least 3.2.3-RC1 so I think I'm good there?
User avatar
halilesen
#3 ·
Posts: 66
Joined: 24 Mar 2024, 18:09
Full Name: Halil ESEN
Has liked: 19
Been liked: 17

Re: How to avatar auto resize on upload?

The extension has no place in extension management. You just need to make "ACP > Avatar settings" as I mentioned in the first post.
BordLord
#4 ·
Posts: 4
Joined: 15 Feb 2025, 00:57
Full Name: Rick White
Been liked: 1

Re: How to avatar auto resize on upload?

So it's active as soon as I changed those settings?

Actually, right under the download link it says to go to the ACP and enable the extension in the customize tab>extension manager and to then go to Avatar settings. Is that no longer correct?
User avatar
halilesen
#5 ·
Posts: 66
Joined: 24 Mar 2024, 18:09
Full Name: Halil ESEN
Has liked: 19
Been liked: 17

Re: How to avatar auto resize on upload?

acp-general-Avatar settings.jpg
acp-general-Avatar settings.jpg (228.02 KiB) Viewed 15000 times

Yes, but this is the default phpBB settings page. Additionally, there are no settings for the extension. Uses default phpBB options.
BordLord
#6 ·
Posts: 4
Joined: 15 Feb 2025, 00:57
Full Name: Rick White
Been liked: 1

Re: How to avatar auto resize on upload?

Ok, I did what you are showing in your screenshot exactly and it's not resizing a picture that is 460x460 to 300x300 and get an error message when I try uploading.

I'm guessing that maybe it shouldn't be installed where the other extensions are?

This is where I installed it.
Attachments
Extension directory.png
Extension directory.png (26.23 KiB) Viewed 14995 times
User avatar
halilesen
#7 ·
Posts: 66
Joined: 24 Mar 2024, 18:09
Full Name: Halil ESEN
Has liked: 19
Been liked: 17

Re: How to avatar auto resize on upload?

No!

You will install it in the /ext folder, not the /ext/phpbb folder. /phpbb in the /ext folder is a author folder just like /ger. You will keep it separate. Then you will enable it from the Customise tab.
BordLord
#8 ·
Posts: 4
Joined: 15 Feb 2025, 00:57
Full Name: Rick White
Been liked: 1

Re: How to avatar auto resize on upload?

That worked! I'm new to this and I really appreciate your help and patience.

Thank you so much. :D
Post Reply
  • Similar Topics