<commit_before>EasyGD
======

EasyGD is a PHP framework to use GD easier<br/>
The frame allows you to easily load images from a file, URL or string.<br/>
After loading the image, you can apply transformations.<br/>
You can then choose to save the result as a file, either to return a character string, or to send the image directly to the browser.<br/>

## Installing

Installation is quite typical - with composer:

```
composer require easygithdev/easygd
```


## The basic stuff 

In all the examples that follow, the $stream variable is either a URL or a file or a character string.<br/>
For example, you can use the following URL:

```php
$stream = 'https://www.php.net/images/logos/new-php-logo.png';
```

#### How to load and show an image

```php
(new Image())->load($stream)->show();
```	

#### How to load and save an image on disk

```php
(new Image())->load($stream)->save('php.png');
```

#### How to load, save and show an image in the same time

```php
(new Image())->load($stream)->save('php.png')->show();
```

#### How to make multiple save

```php
(new Image())->load($stream)->save('php.png')
->setType(IMAGETYPE_GIF)->save('php.gif')
->setType(IMAGETYPE_JPEG)->save('php.jpg');
```

----

## Include the image in the HTML

You can use the data src property to render the image quickly in the HTML tag.<br />
Use it only on small image, if you dont want that your html page becommes to big. 

```php
<img src="<?php echo (new Image())->load($stream)->dataSrc() ?>" />
```

## The other types

#### Define a dimension
<commit_msg>better readme<commit_after>EasyGD
======

EasyGD is a PHP framework to use GD easier<br/>
The frame allows you to easily load images from a file, URL or string.<br/>
After loading the image, you can apply transformations.<br/>
You can then choose to save the result as a file, either to return a character string, or to send the image directly to the browser.<br/>

## Installing

Installation is quite typical - with composer:

```
composer require easygithdev/easygd
```

## The header script

You will need to include the autoloader before using the classes.

```php
<?php

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

use Easygd\Image;

```

## The basic stuff 

In all the examples that follow, the $stream variable is either a URL or a file or a character string.<br/>
For example, you can use the PHP logo with the following URL:

```php
$stream = 'https://www.php.net/images/logos/new-php-logo.png';
```

![PHP Logo](https://www.php.net/images/logos/new-php-logo.png)

#### How to load and show an image

In this case, the stream is directly sent to the browser.

```php
(new Image())->load($stream)->show();
```	

#### How to load and render an image in a HTML tag

You can use the data src property to render the image in the HTML tag.<br />
Use it only on small image, if you dont want that your HTML page becommes to big. 

```php
<img src="<?php echo (new Image())->load($stream)->dataSrc() ?>" />
```

#### How to load and save an image on disk

In this case, the stream is saved to the browser.

```php
(new Image())->load($stream)->save('php.png');
```

#### How to load, save and show an image in the same time

```php
(new Image())->load($stream)->save('php.png')->show();
```

#### How to make multiple save

```php
(new Image())->load($stream)->save('php.png')
->setType(IMAGETYPE_GIF)->save('php.gif')
->setType(IMAGETYPE_JPEG)->save('php.jpg');
```

----


## The other types

#### Define a dimension

{'fraction_non_alphanumeric': 0.15619596541786743, 'fraction_numerical': 0.0, 'mean_word_length': 4.104411764705882, 'pattern_counts': {'":': 0, '<': 20, '<?xml version=': 0, '>': 49, 'https://': 3, 'lorem ipsum': 0, 'www.': 3, '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': '4832261', 'n_tokens_mistral': 1105, 'n_tokens_neox': 1058, 'n_words': 453}