Skip to content

Commit

Permalink
Merge pull request #8 from wiejakp/v1.0.6
Browse files Browse the repository at this point in the history
v1.0.6
  • Loading branch information
wiejakp committed Mar 3, 2020
2 parents 39ae6cb + 66eed8d commit 2dab150
Show file tree
Hide file tree
Showing 65 changed files with 882 additions and 12,153 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
.phpunit.result.cache
/phpunit.xml
/vendor/
build
vendor
composer.lock
.DS_Store
10 changes: 8 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
All notable changes to this project will be documented in this file.


## [1.0.6] - 2019-11-25

* Adding and updating code unit tests.
* Readme changes.

## [1.0.5] - 2019-09-23

### Notes
Expand Down Expand Up @@ -45,16 +50,17 @@ All notable changes to this project will be documented in this file.
* Add easy to implement readers which are using build-in PHP image functions.


## [1.0] - 2019-08-19
## [1.0.0] - 2019-08-19

### Notes

* Initial release.


[1.0.6]: https://github.com/wiejakp/ImageCrop/releases/tag/v1.0.6
[1.0.5]: https://github.com/wiejakp/ImageCrop/releases/tag/v1.0.5
[1.0.4]: https://github.com/wiejakp/ImageCrop/releases/tag/v1.0.4
[1.0.3]: https://github.com/wiejakp/ImageCrop/releases/tag/v1.0.3
[1.0.2]: https://github.com/wiejakp/ImageCrop/releases/tag/v1.0.2
[1.0.1]: https://github.com/wiejakp/ImageCrop/releases/tag/v1.0.1
[1.0]: https://github.com/wiejakp/ImageCrop/releases/tag/v1.0
[1.0.0]: https://github.com/wiejakp/ImageCrop/releases/tag/v1.0
58 changes: 46 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@
[![Software License][badge-license]][license]
[![PHP Version][badge-php]][php]
[![Build Status][badge-build]][build]
[![Coverage Status](https://coveralls.io/repos/github/wiejakp/ImageCrop/badge.svg)](https://coveralls.io/github/wiejakp/ImageCrop)
[![Coverage Status][badge-coverage]][coverage]
[![Total Downloads][badge-downloads]][downloads]
<!--[![Coverage Status][badge-coverage]][coverage]-->


This project adheres to a [Contributor Code of Conduct][conduct]. By
Expand All @@ -26,9 +25,9 @@ composer require wiejakp/image-crop
```


## Usage
## Basic Usage

```
```php
$imagePath = 'image.jpeg';

$imageCrop = (new ImageCrop())
Expand All @@ -39,10 +38,7 @@ $imageCrop = (new ImageCrop())
$imageCrop->getReader()->loadFromPath($imagePath);

// perform cropping actions
$imageCrop->cropTop();
$imageCrop->cropRight();
$imageCrop->cropBottom();
$imageCrop->cropLeft();
$imageCrop->crop();

// skip images that appear to be empty
if (false === $imageCrop->isEmpty()) {
Expand All @@ -51,10 +47,48 @@ if (false === $imageCrop->isEmpty()) {
$imageCrop->getWriter()->write();

// do stuff with $imageCrop->getData() or $imageCrop->getDataUri()
$anchor = \sprintf('<a href="$s">anchor</a>', $imageCrop->getDataUri());
...
}
```


## Reader And Writers

You can mix nad match what image resource is being loaded and what image resource is being generated out.

##### BMP Reader And Writer

```php
$imageCrop = (new ImageCrop())
->setReader(BMPReader::class)
->setWriter(BMPWriter::class);
```

##### GIF Reader And Writer

```php
$imageCrop = (new ImageCrop())
->setReader(GIFReader::class)
->setWriter(GIFWriter::class);
```

##### JPEG Reader And Writer

```php
$imageCrop = (new ImageCrop())
->setReader(JPEGReader::class)
->setWriter(JPEGWriter::class);
```

##### PNG Reader And Writer

```php
$imageCrop = (new ImageCrop())
->setReader(PNGReader::class)
->setWriter(PNGWriter::class);
```

## Documentation

Check out the [documentation website][documentation] for detailed information
Expand All @@ -78,18 +112,18 @@ more information.
[documentation]: https://wiejakp.github.io/ImageCrop/
[contributing]: https://github.com/wiejakp/ImageCrop/blob/master/.github/CONTRIBUTING.md

[badge-source]: http://img.shields.io/badge/source-wiejakp/image-crop.svg?style=flat-square
[badge-source]: https://img.shields.io/badge/source-wiejakp%2Fimage--crop-brightgreen
[badge-release]: https://img.shields.io/packagist/v/wiejakp/image-crop.svg?style=flat-square&label=release
[badge-license]: https://img.shields.io/packagist/l/wiejakp/image-crop.svg?style=flat-square
[badge-php]: https://img.shields.io/packagist/php-v/wiejakp/image-crop.svg?style=flat-square
[badge-build]: https://img.shields.io/travis/wiejakp/imagecrop?style=flat-square
<!--[badge-coverage]: https://img.shields.io/coveralls/github/wiejakp/ImageCrop/master.svg?style=flat-square-->
[badge-coverage]: https://img.shields.io/coveralls/github/wiejakp/ImageCrop
[badge-downloads]: https://img.shields.io/packagist/dt/wiejakp/image-crop.svg?style=flat-square&colorB=mediumvioletred

[source]: https://github.com/wiejakp/ImageCrop
[packagist]: https://packagist.org/packages/wiejakp/ImageCrop
[license]: https://github.com/wiejakp/ImageCrop/blob/master/LICENSE
[php]: https://php.net
[build]: https://travis-ci.org/wiejakp/ImageCrop
<!--[coverage]: https://coveralls.io/repos/github/wiejakp/ImageCrop/badge.svg?branch=master-->
[downloads]: https://packagist.org/packages/wiejakp/ImageCrop
[coverage]: https://coveralls.io/github/wiejakp/ImageCrop?branch=master
[downloads]: https://packagist.org/packages/wiejakp/image-crop
1 change: 0 additions & 1 deletion VERSION

This file was deleted.

7 changes: 0 additions & 7 deletions build/coverage.txt

This file was deleted.

125 changes: 0 additions & 125 deletions build/coverage/Exception/DoNotCallDirectlyException.php.html

This file was deleted.

Loading

0 comments on commit 2dab150

Please sign in to comment.