Download .zip |
Info | Documentation | Screenshots | View files (5) | Download .zip | Reputation | Support forum | Blog | Links |
Last Updated | Ratings | Unique User Downloads | Download Rankings | |||||
2018-07-09 (2 months ago) | Not enough user ratings | Total: 170 This week: 5 | All time: 8,413 This week: 93 |
Version | License | PHP version | Categories | |||
zx-avatar-generator 1.1.2 | BSD License | 7.1 | Graphics, PHP 7 |
Description | Author | |
This class can generate an image for a person with a given name. Recommendations Generate avatar from given name Innovation Award
|
Generate avatar for user by his name, file or url.
Install with composer:
composer require zertex/avatar-generator
or add
"zertex/avatar-generator": "*"
to the require section of your composer.json
file.
$options = AvatarOptions::create()
->setFont('path to ttf font')
->setWidth(300)
->setFontSize(200)
->setTexturesFolder('path to textures folder')
->setImagesFolder('path to generated images folder')
->setImagesUrl('url to images folder')
->setSalt('random salt');
Generate avatar image by username
$image_src = Avatar::init('John Smith', $options, [result file name])
->username()
->texture('TEXTURE_NAME')
->text()
->get_file_name();
Generate avatar image from file
$image_src = Avatar::init('John Smith', $options, [result file name])
->file('/path/to/file')
->texture('TEXTURE_NAME')
->text()
->get_file_name();
Generate avatar image from url
$image_src = Avatar::init('John Smith', $options, [result file name])
->file('http://your-site.com/image.jpg')
->texture('TEXTURE_NAME')
->text()
->get_file_name();
You can exclude texture or text from chain for exclude them
You can use PNG texture with transparancy. Every texture must consist of 2 files (back & white). His names myst be:
TEXTURE_NAME . '-' . COLOR . '.png'
black
or white
Avater generator extension for Yii2 here: https://github.com/zertex/yii2-avatar-generator
https://zertex.ru/yii2-avatar-generator
Screenshots | ||
Files |
File | Role | Description | ||
---|---|---|---|---|
src (2 files) | ||||
composer.json | Data | Auxiliary data | ||
LICENCE.md | Lic. | License text | ||
README.md | Doc. | Documentation |
Files | / | src |
File | Role | Description |
---|---|---|
Avatar.php | Class | Class source |
AvatarOptions.php | Class | Class source |
zx-avatar-generator-2018-07-09.zip 277KB | |
zx-avatar-generator-2018-07-09.tar.gz 277KB | |
Install with Composer |
Version Control | Unique User Downloads | Download Rankings | |||||||||||||||
83% |
|
|
Applications that use this package |
If you know an application of this package, send a message to the author to add a link here.