Jump to content

Community

Adlago

Generate profile photos

Recommended Posts

Yeah, the letter avatars is nice. But it can be quite resource intensive for the browser so a solution would be good. 

Especially now that Google will take into consideration the site speed when displaying search results.

Edited by David..

Share this post


Link to post
Share on other sites

I was wondering why profile photos of guests don't get a letter (based on the chosen guest name)? It looks weird to see a mix of letter and non-letter profiel photos. Or is there a setting to turn on letter profile photos for guests, too?

Share this post


Link to post
Share on other sites
16 hours ago, MMXII said:

I was wondering why profile photos of guests don't get a letter (based on the chosen guest name)? It looks weird to see a mix of letter and non-letter profiel photos. Or is there a setting to turn on letter profile photos for guests, too?

Because image files are generated and mapped as the user's profile photo presently, letter photos are unavailable for guests.

Share this post


Link to post
Share on other sites

Okay, but does anyone know how to rebulid / delete default letter avatars? the point is to change their size to a smaller one. Maybe someone will write a simple function?

Edited by SeNioR-

Share this post


Link to post
Share on other sites
18 hours ago, bfarber said:

Because image files are generated and mapped as the user's profile photo presently, letter photos are unavailable for guests.

Hm... I've seen a forum software of at least one competitor that uses letter avatars for guests, too. I am not too familiar with the technical aspect of IPS4, but I assume this should also be possible here? Of course this is no "must have", but I think it would be a nice addition to make the feature itself more complete. I really like the letter avatars.

Share this post


Link to post
Share on other sites

Displaying an avatar with a letter and color is a good idea, but think realization is bad - too many and large images that delay the loading site.

I had an idea - avatars without images(w00t)

What do I think about this?

- The first letter is saved in a text format in the avatar area.

- Background color for avatar area is generated, for example, from the decimal code 'joined' from the core_members table. The last 6 digits converted to a hexadecimal code are used. And this is an individual background avatar.

There are no images, but there is an avatar with a letter.
What do developers think - is this possible?

Share this post


Link to post
Share on other sites

If one is concerned about the loading speed, once can just turn the letter avatars off. No one is forcing you to use them. 

Doing it without images is possible, but it leads to all sort of new problems. 

Share this post


Link to post
Share on other sites

Does anybody know how this is done in XF (XenForo) or WCS (WoltLab Community Suite)? Whenever I browse sites that use these software, it feels like there is no delay at all.

Share this post


Link to post
Share on other sites
5 hours ago, MMXII said:

Does anybody know how this is done in XF (XenForo) or WCS (WoltLab Community Suite)? Whenever I browse sites that use these software, it feels like there is no delay at all.

In XenForo they use CSS + HTML instead of images. It's the best way to do this kind of things. E.g.:

Avatar taken from index page of this forums sized 8 kb:

avatar.png.706b3791d679ba8333bfc8ee6b509764.png

Exactly the same thing done with CSS + HTML sized less than 0.2 kb and can be much lower because most part of it will be moved to one CSS class (everything except color), so in result it will sized about 0.05 KB.

M

Share this post


Link to post
Share on other sites
On 16.02.2018 at 4:46 AM, SeNioR- said:

Okay, but does anyone know how to rebulid / delete default letter avatars? the point is to change their size to a smaller one. Maybe someone will write a simple function?

Thats is what I am wondering too. May be @bfarber can help :)

Share this post


Link to post
Share on other sites
On 2/16/2018 at 12:46 PM, SeNioR- said:

Okay, but does anyone know how to rebulid / delete default letter avatars? the point is to change their size to a smaller one. Maybe someone will write a simple function?

Was there an easy way of doing this?

Share this post


Link to post
Share on other sites

I confirm that it is possible to go to avatr svg without problems. We did it. As for the regeneration of new avatars, taking advantage of the new settings, just run this query
update `core_members` set` pp_main_photo` = NULL, `pp_photo_type` = NULL where` pp_thumb_photo` is null

But eye that the old avatar remain in the servant and then you will have a lot of useless images .... Otherwise, you have to download all the folders with the avatar and use an automatic resizing software ...

Share this post


Link to post
Share on other sites
Posted (edited)

Exactly the same problem with profile backgrounds. They also can be recreated via CSS with a HUGE saving in size, bandwidth and loading time. For example, default background of user which posted above weights 735 KB. It's more than whole code and other resources of this page altogether. Too big waste of disc space and traffic.

Edited by Mr 13

Share this post


Link to post
Share on other sites

I think IPS should implement a solution where the default letter avatar is generating an .SVG file - smaller, looks good on HiDPI (aka "Retina") displays, and is dynamic - user changes their username (if allowed), the letter avatar can be regenerated.

Or perhaps write an inline SVG at page render time? Should be easy to take the first letter of the User name, choose a random hex value for the background colour and generate the object.

The ultimate would be to allow the user to customize the colour (and perhaps the shape - why only circles - why not polygons, squares, etc.) via their User CP...

Share this post


Link to post
Share on other sites

  • Recently Browsing   0 members

    No registered users viewing this page.

×