diff --git a/CHANGELOG.md b/CHANGELOG.md index 5c0e271..01649f2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,11 @@ All notable changes to `svg-avatar-generator` will be documented in this file. +## 1.2.0 + +- Support for custom extractor. +- New key `extractor` in **svg-avatar** config. + ## 1.1.0 - Support for setting multiple sets of gradient colors. diff --git a/README.md b/README.md index 34c4606..2fdd5a4 100644 --- a/README.md +++ b/README.md @@ -4,18 +4,18 @@ [![GitHub Tests Action Status](https://img.shields.io/github/actions/workflow/status/sowrensen/svg-avatar-generator/run-tests.yml?branch=main&label=Tests)](https://github.com/sowrensen/svg-avatar-generator/actions?query=workflow%3ATests+branch%3Amain) [![Total Downloads](https://img.shields.io/packagist/dt/sowrensen/svg-avatar-generator.svg)](https://packagist.org/packages/sowrensen/svg-avatar-generator) -Generating SVG avatars on the fly is nothing new. There are a lot of free/paid services and packages to do that. So why +Generating SVG avatars on the fly is nothing new. There are tons of free/paid services and packages available to do that. So, why another package for same task? -Well, this package has some subtle advantages over available packages, here's a few of them: +Well, this one has some subtle but nifty advantages over available packages, here's a few of them: -- [x] No external api call is required. ๐Ÿค๐Ÿผ +- [x] No external api call is required, it's totally offline. ๐Ÿ›ฐ๏ธ - [x] Unlike some other available options, doesn't require heavy-weight image processing libraries like **Intervention**. ๐Ÿงบ - [x] Doesn't have any binary dependency, so nothing needs to be installed on server. ๐Ÿ—ƒ๏ธ - [x] Supports gradient background. ๐Ÿฆœ - [x] Supports random gradients based on defined presets in config. ๐Ÿฆš -- [x] Ability to customize initials. โœ๐Ÿผ +- [x] Ability to customize initials and extractor. โœ๐Ÿผ ## Requirements @@ -106,6 +106,33 @@ You can define the second initial using studly case. For example, | Johndoe | JO | | JohndoE | JE | +### Customize Extractor + +The default initial extractor class produces results shown above. However, if you want something different, you can create your own Extractor class. To do so create a new class that implements `Sowren\SvgAvatarGenerator\Extractors\Extractor` interface. An ideal place to put this class would be under `App\Extractors` namespace in your app directory. + +```php + App\Extractors\CustomExtractor::class, +``` + ## Sample Output