Library for generating custom images for the site

    Not so long ago I had a need to connect pseudo-random user pictures (user peaks) to the project, 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 search for the class I needed on the Internet.

    The search went on for about 30 minutes, for which I couldn’t find anything acceptable, from the category “connected - it worked”, and so I whipped up a small class into PHP that does what I need and meets the above principle. Actually, while I was looking for the solution I needed, it turned out that I was not alone in such searches, so I decided to put this class in public access: you never know who needs it.

    The class is called Avatarco.
    For full-fledged work, PHP5> = 5.3.0 is required, but by changing one line you can make it work on PHP5 lower than 5.3.0.
    A description of the class’s operation and its source code is available at code.google.com/p/avatarco

    Here is a random example of its operation (or follow the link and update): I hope it will be useful not only to me. I am pleased to hear comments about bugs and the necessary improvements / improvements.
    image



    Also popular now: