<commit_before># Azure Thumbnails

Create image thumbnails with help of Microsoft Artificial Intelligence, and show what needed!

![gevman/azure-thumbnails](http://i.imgur.com/Y2hI8D8.png)

## Installation (using composer)

```bash
composer require gevman/azure-thumbnails
```

### Methods

##### thumbnail(string $image, int $width, int $height)
###### Create thumbnail
- `$image` - full path of image
- `$width` - thumbnail width
- `$height` - thumbnail height

##### saveAs(string $file \[, int $quality = 99\])
###### Save thumbnail to specified path
- `$file` - full path of thumbnail
- `$quality` - thumbnail quality


##### show(\[int $quality = 99\])
###### Show thumbnail
- `$quality` - thumbnail quality


### Example of usage

###### Get your `Computer Vision API key` from [Microsoft Azure](https://portal.azure.com/#create/Microsoft.CognitiveServices/apitype/ComputerVision)

```php
require '../vendor/autoload.php';

$generator = new \Gevman\Thumbnails\Generator('{Computer Vision API key}');

$thumb = $generator->thumbnail('/full/path/to/original.jpg', 1000, 500);

//will save thumbnail to specified path
$thumb->saveAs('/full/path/to/thumbnail.jpg', 100);

//will save show thumbnail
$thumb->show();
```<commit_msg>1.0.0 - read.me fix<commit_after># Azure Thumbnails

Create image thumbnails with help of Microsoft Artificial Intelligence, and show what needed!

![gevman/azure-thumbnails](http://i.imgur.com/Y2hI8D8.png)

## Installation (using composer)

```bash
composer require gevman/azure-thumbnails
```

### Methods

##### thumbnail(string $image, int $width, int $height)
###### Create thumbnail
- `$image` - full path of image
- `$width` - thumbnail width
- `$height` - thumbnail height

##### saveAs(string $file \[, int $quality = 99\])
###### Save thumbnail to specified path
- `$file` - full path of thumbnail
- `$quality` - thumbnail quality


##### show(\[int $quality = 99\])
###### Show thumbnail
- `$quality` - thumbnail quality


### Example of usage

###### Get your `Computer Vision API key` from [Microsoft Azure](https://portal.azure.com/#create/Microsoft.CognitiveServices/apitype/ComputerVision)

```php
require '../vendor/autoload.php';

$generator = new \Gevman\Thumbnails\Generator('{Computer Vision API key}');

$thumb = $generator->thumbnail('/full/path/to/original.jpg', 1000, 500);

//will save thumbnail to specified path
$thumb->saveAs('/full/path/to/thumbnail.jpg', 100);

//will show thumbnail
$thumb->show();
```
{'fraction_non_alphanumeric': 0.1767328739359546, 'fraction_numerical': 0.014997973246858533, 'mean_word_length': 4.699769053117783, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4951333', 'n_tokens_mistral': 841, 'n_tokens_neox': 772, 'n_words': 217}