📜 ⬆️ ⬇️

Library of generating custom images for the site

Not so long ago I had the need to connect to the project pseudo-random user pictures (userpics), the settings for which are tied to some personal user information (login, password, e-mail, whatever). I know about the existence of Gravatar and similar projects, but I really did not want to turn to third-party services for such a trifle, so I began to look for the class I needed on the Internet.

The search continued for about 30 minutes, for which I did not find anything acceptable, from the category of “connect - earned,” and therefore quickly sketched a small class in PHP that does what I need and answers the above principle. Actually, while I was looking for the solution I needed, it turned out that in such a search I was not alone, so I decided to put this class in public access: you never know who will need it.

The class is called Avatarco.
PHP5> = 5.3.0 is required for full-fledged work, but changing one line can be made to work on PHP5 lower than 5.3.0.
The job description of the class and its source code are available at code.google.com/p/avatarco
Here is a random example of its work (or follow the link and update):

I hope it is useful not only for me.
I am pleased to hear comments on errors and necessary improvements / improvements.

Source: https://habr.com/ru/post/101365/

All Articles