Skip to content

Commit

Permalink
Initial commit (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
terabytesoftw authored Oct 26, 2023
1 parent 352d72e commit b1eb2d6
Show file tree
Hide file tree
Showing 20 changed files with 1,030 additions and 75 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,13 @@ on:
- 'infection.json.dist'
- 'psalm.xml'

name: build
name: gmagick

jobs:
phpunit:
uses: yiisoft/actions/.github/workflows/phpunit.yml@master
with:
extensions: intl, gmagick
os: >-
['ubuntu-latest', 'windows-latest']
php: >-
Expand Down
32 changes: 32 additions & 0 deletions .github/workflows/imagick.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
on:
pull_request:
paths-ignore:
- 'docs/**'
- 'README.md'
- 'CHANGELOG.md'
- '.gitignore'
- '.gitattributes'
- 'infection.json.dist'
- 'psalm.xml'

push:
paths-ignore:
- 'docs/**'
- 'README.md'
- 'CHANGELOG.md'
- '.gitignore'
- '.gitattributes'
- 'infection.json.dist'
- 'psalm.xml'

name: imagick

jobs:
phpunit:
uses: yiisoft/actions/.github/workflows/phpunit.yml@master
with:
extensions: intl, imagick
os: >-
['ubuntu-latest', 'windows-latest']
php: >-
['8.1', '8.2', '8.3']
59 changes: 42 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<p align="center">
<a href="https://github.com/yii2-extensions/template" target="_blank">
<a href="https://github.com/yii2-extensions/imagine" target="_blank">
<img src="https://www.yiiframework.com/image/yii_logo_light.svg" height="100px;">
</a>
<h1 align="center">Yii2-Template.</h1>
<h1 align="center">Imagine</h1>
<br>
</p>

Expand All @@ -13,32 +13,57 @@
<a href="https://github.com/yiisoft/yii2/tree/2.2" target="_blank">
<img src="https://img.shields.io/badge/Yii2%20version-2.2-blue" alt="yii2-version">
</a>
<a href="https://github.com/yii2-extensions/template/actions/workflows/build.yml" target="_blank">
<img src="https://github.com/yii2-extensions/template/actions/workflows/build.yml/badge.svg" alt="PHPUnit">
<a href="https://github.com/yii2-extensions/imagine/actions/workflows/build.yml" target="_blank">
<img src="https://github.com/yii2-extensions/imagine/actions/workflows/build.yml/badge.svg" alt="PHPUnit">
</a>
<a href="https://codecov.io/gh/yii2-extensions/template" target="_blank">
<img src="https://codecov.io/gh/yii2-extensions/template/branch/main/graph/badge.svg?token=MF0XUGVLYC" alt="Codecov">
</a>
<a href="https://github.com/yii2-extensions/template/actions/workflows/static.yml" target="_blank">
<a href="https://codecov.io/gh/yii2-extensions/imagine" target="_blank">
<img src="https://codecov.io/gh/yii2-extensions/imagine/graph/badge.svg?token=Sx1GlGe8n2" alt="Codecov">
</a>
<a href="https://github.com/yii2-extensions/imagine/actions/workflows/static.yml" target="_blank">
<img src="https://github.com/yii2-extensions/gii/actions/workflows/static.yml/badge.svg" alt="PHPStan">
</a>
<a href="https://github.com/yii2-extensions/template/actions/workflows/static.yml" target="_blank">
<img src="https://img.shields.io/badge/PHPStan%20level-2-blue" alt="PHPStan level">
</a>
<a href="https://github.styleci.io/repos/698621511?branch=main" target="_blank">
<img src="https://github.styleci.io/repos/698621511/shield?branch=main" alt="Code style">
<a href="https://github.com/yii2-extensions/imagine/actions/workflows/static.yml" target="_blank">
<img src="https://img.shields.io/badge/PHPStan%20level-3-blue" alt="PHPStan level">
</a>
<a href="https://github.styleci.io/repos/708447136?branch=main" target="_blank">
<img src="https://github.styleci.io/repos/708447136/shield?branch=main" alt="Code style">
</a>
</p>

## Requirements
## Installation

The preferred way to install this extension is through [composer](https://getcomposer.org/download/).

Either run

The minimun version of `PHP` required by this package is `PHP 8.1`.
```
php composer.phar require --dev --prefer-dist yii2-extensions/imagine
```

For install this package, you need [composer](https://getcomposer.org/).
or add

```
"yii2-extensions/imagine": "dev-main"
```

to the require-dev section of your `composer.json` file.

## Usage

[Check the documentation docs](/docs/README.md) to learn about usage.
This extension is a wrapper to the [Imagine](https://imagine.readthedocs.org/) and also adds the most commonly used
image manipulation methods.

The following example shows how to use this extension:

```php
use yii\imagine\Image;

// frame, rotate and save an image
Image::frame('path/to/image.jpg', 5, '666', 0)
->rotate(-8)
->save('path/to/destination/image.jpg', ['jpeg_quality' => 50]);
```


## Testing

Expand Down
16 changes: 10 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
{
"name": "yii2/template",
"type": "library",
"description": "_____",
"name": "yii2-extensions/imagine",
"type": "yii2-extension",
"description": "The Imagine integration for the Yii framework.",
"keywords": [
"_____"
"yii2",
"imagine",
"image",
"helper"
],
"license": "mit",
"minimum-stability": "dev",
"prefer-stable": true,
"require": {
"php": ">=8.1",
"imagine/imagine": "^1.3",
"yiisoft/yii2": "^2.2"
},
"require-dev": {
Expand All @@ -19,12 +23,12 @@
},
"autoload": {
"psr-4": {
"yii\\template\\": "src"
"yii\\imagine\\": "src"
}
},
"autoload-dev": {
"psr-4": {
"yii\\template\\tests\\": "tests"
"yiiunit\\imagine\\": "tests"
}
},
"extra": {
Expand Down
2 changes: 1 addition & 1 deletion phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ parameters:
- YII_ENV_PROD
- YII_ENV_TEST

level: 2
level: 3

paths:
- src
Expand Down
38 changes: 19 additions & 19 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.2/phpunit.xsd"
bootstrap="vendor/autoload.php"
cacheDirectory=".phpunit.cache"
colors="true"
executionOrder="depends,defects"
failOnRisky="true"
failOnWarning="true"
stopOnFailure="false"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.2/phpunit.xsd"
bootstrap="tests/bootstrap.php"
cacheDirectory=".phpunit.cache"
colors="true"
executionOrder="depends,defects"
failOnRisky="true"
failOnWarning="true"
stopOnFailure="false"
>
<testsuites>
<testsuite name="Template">
<directory>tests</directory>
</testsuite>
</testsuites>
<testsuites>
<testsuite name="Yii2-Imagine">
<directory>tests</directory>
</testsuite>
</testsuites>

<source>
<include>
<directory suffix=".php">./src</directory>
</include>
</source>
<source>
<include>
<directory suffix=".php">./src</directory>
</include>
</source>
</phpunit>
Loading

0 comments on commit b1eb2d6

Please sign in to comment.