diff --git a/composer.json b/composer.json index 91c9580..7e68047 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "antonlukin/poster-editor", - "version": "5.10", + "version": "5.11", "description": "Wrapper for PHP's GD Library for easy image manipulation", "keywords": ["php", "image", "text", "gd"], "homepage": "https://github.com/antonlukin/poster-editor", diff --git a/composer.lock b/composer.lock index cb15048..6b5d9d4 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "fa1ae83b947edb8ef9a07ec5e320a81b", + "content-hash": "dc77e2413788c56666513036361072c8", "packages": [], "packages-dev": [ { @@ -146,16 +146,16 @@ }, { "name": "squizlabs/php_codesniffer", - "version": "3.7.2", + "version": "3.8.1", "source": { "type": "git", - "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "ed8e00df0a83aa96acf703f8c2979ff33341f879" + "url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git", + "reference": "14f5fff1e64118595db5408e946f3a22c75807f7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/ed8e00df0a83aa96acf703f8c2979ff33341f879", - "reference": "ed8e00df0a83aa96acf703f8c2979ff33341f879", + "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/14f5fff1e64118595db5408e946f3a22c75807f7", + "reference": "14f5fff1e64118595db5408e946f3a22c75807f7", "shasum": "" }, "require": { @@ -165,11 +165,11 @@ "php": ">=5.4.0" }, "require-dev": { - "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" + "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.3.4" }, "bin": [ - "bin/phpcs", - "bin/phpcbf" + "bin/phpcbf", + "bin/phpcs" ], "type": "library", "extra": { @@ -184,22 +184,45 @@ "authors": [ { "name": "Greg Sherwood", - "role": "lead" + "role": "Former lead" + }, + { + "name": "Juliette Reinders Folmer", + "role": "Current lead" + }, + { + "name": "Contributors", + "homepage": "https://github.com/PHPCSStandards/PHP_CodeSniffer/graphs/contributors" } ], "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", - "homepage": "https://github.com/squizlabs/PHP_CodeSniffer", + "homepage": "https://github.com/PHPCSStandards/PHP_CodeSniffer", "keywords": [ "phpcs", "standards", "static analysis" ], "support": { - "issues": "https://github.com/squizlabs/PHP_CodeSniffer/issues", - "source": "https://github.com/squizlabs/PHP_CodeSniffer", - "wiki": "https://github.com/squizlabs/PHP_CodeSniffer/wiki" + "issues": "https://github.com/PHPCSStandards/PHP_CodeSniffer/issues", + "security": "https://github.com/PHPCSStandards/PHP_CodeSniffer/security/policy", + "source": "https://github.com/PHPCSStandards/PHP_CodeSniffer", + "wiki": "https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki" }, - "time": "2023-02-22T23:07:41+00:00" + "funding": [ + { + "url": "https://github.com/PHPCSStandards", + "type": "github" + }, + { + "url": "https://github.com/jrfnl", + "type": "github" + }, + { + "url": "https://opencollective.com/php_codesniffer", + "type": "open_collective" + } + ], + "time": "2024-01-11T20:47:48+00:00" } ], "aliases": [], diff --git a/example/images/belgrade.webp b/example/images/belgrade.webp new file mode 100644 index 0000000..3b2988d Binary files /dev/null and b/example/images/belgrade.webp differ diff --git a/example/webp.php b/example/webp.php new file mode 100644 index 0000000..7bf4a07 --- /dev/null +++ b/example/webp.php @@ -0,0 +1,22 @@ + + * @license MIT License (http://www.opensource.org/licenses/mit-license.php) + * @link https://github.com/antonlukin/poster-editor + */ + +require_once __DIR__ . '/../vendor/autoload.php'; + +try { + $image = new PosterEditor\PosterEditor(); + $image->make('images/belgrade.webp')->fit(1000, 400)->blackout(50); + $image->show(); + +} catch(Exception $e) { + echo $e->getMessage(); +} diff --git a/src/PosterEditor.php b/src/PosterEditor.php index 24dc1ae..d6c2d0a 100644 --- a/src/PosterEditor.php +++ b/src/PosterEditor.php @@ -23,7 +23,7 @@ * @package PosterEditor * @author Anton Lukin * @license MIT License (http://www.opensource.org/licenses/mit-license.php) - * @version Release: 5.10 + * @version Release: 5.11 * @link https://github.com/antonlukin/poster-editor */ class PosterEditor @@ -1138,6 +1138,7 @@ protected function getSource($file, $type) case IMAGETYPE_WEBP: $source = imagecreatefromwebp($file); + break; default: return $this->handleError('Unsupported image type');