From 55a68ca85fc73ae80e6809e7a529a13e764980bf Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 2 Aug 2024 11:58:51 +0100 Subject: [PATCH] build(deps): bump intervention/image from 2.7.2 to 3.7.2 (#784) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * build(deps): bump intervention/image from 2.7.2 to 3.7.2 Bumps [intervention/image](https://github.com/Intervention/image) from 2.7.2 to 3.7.2. - [Release notes](https://github.com/Intervention/image/releases) - [Commits](https://github.com/Intervention/image/compare/2.7.2...3.7.2) --- updated-dependencies: - dependency-name: intervention/image dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] * upgrade to intervention/image v3 --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Andrei Ioniță --- .../Controllers/Admin/SettingController.php | 3 +- app/Models/Media.php | 4 +- app/Providers/MediaServiceProvider.php | 13 +- composer.json | 2 +- composer.lock | 177 +++++++++++++++--- 5 files changed, 162 insertions(+), 37 deletions(-) diff --git a/app/Http/Controllers/Admin/SettingController.php b/app/Http/Controllers/Admin/SettingController.php index c8e69043..c33dfc7b 100644 --- a/app/Http/Controllers/Admin/SettingController.php +++ b/app/Http/Controllers/Admin/SettingController.php @@ -14,6 +14,7 @@ use Illuminate\Support\Str; use Inertia\Inertia; use Inertia\Response; +use Intervention\Image\FileExtension; use Intervention\Image\Image; class SettingController extends Controller @@ -54,7 +55,7 @@ public function store(string $section, SettingRequest $request): RedirectRespons 'logo' => $value?->storePubliclyAs('assets', 'logo.' . $value?->extension()), 'favicon' => $value ?->manipulate(function (Image $image) { - $image->fit(48, 48)->encode('png'); + $image->scaleDown(48, 48)->encodeByExtension(FileExtension::PNG); }) ->storePubliclyAs('assets', 'favicon.' . $value?->extension()), } diff --git a/app/Models/Media.php b/app/Models/Media.php index f228c6c6..cd2718b8 100644 --- a/app/Models/Media.php +++ b/app/Models/Media.php @@ -8,7 +8,7 @@ use App\Traits\Translatable; use Illuminate\Database\Eloquent\Builder; use Illuminate\Support\Collection; -use Intervention\Image\Facades\Image; +use Intervention\Image\Laravel\Facades\Image; use Plank\Mediable\Jobs\CreateImageVariants; use Plank\Mediable\Media as BaseMedia; @@ -35,7 +35,7 @@ public static function booted() { static::saving(function (self $media) { if ($media->aggregate_type === self::TYPE_IMAGE) { - $image = Image::make($media->contents()); + $image = Image::read($media->contents()); $media->forceFill([ 'width' => $image->width(), diff --git a/app/Providers/MediaServiceProvider.php b/app/Providers/MediaServiceProvider.php index da06839f..5d921068 100644 --- a/app/Providers/MediaServiceProvider.php +++ b/app/Providers/MediaServiceProvider.php @@ -7,9 +7,8 @@ use Illuminate\Http\UploadedFile; use Illuminate\Support\Collection; use Illuminate\Support\ServiceProvider; -use Intervention\Image\Constraint; -use Intervention\Image\Facades\Image as ImageFacade; use Intervention\Image\Image; +use Intervention\Image\Laravel\Facades\Image as ImageFacade; use Plank\Mediable\Facades\ImageManipulator; use Plank\Mediable\ImageManipulation; @@ -34,7 +33,7 @@ protected function registerMacros(): void { UploadedFile::macro('manipulate', function (callable $callback) { return tap($this, function (UploadedFile $file) use ($callback) { - $image = ImageFacade::make($file->getPathname()); + $image = ImageFacade::read($file->getPathname()); $callback($image); @@ -47,14 +46,10 @@ protected function imageVariants(): Collection { return collect([ 'thumb' => ImageManipulation::make(function (Image $image) { - $image->resize(256, 256, function (Constraint $constraint) { - $constraint->aspectRatio(); - }); + $image->scaleDown(256, 256); }), '600' => ImageManipulation::make(function (Image $image) { - $image->resize(600, 600, function (Constraint $constraint) { - $constraint->aspectRatio(); - }); + $image->scaleDown(600, 600); }), ]); } diff --git a/composer.json b/composer.json index 5945db6d..276fb109 100644 --- a/composer.json +++ b/composer.json @@ -18,7 +18,7 @@ "guzzlehttp/guzzle": "^7.9", "hafael/azure-mailer-driver": "^0.3.0", "inertiajs/inertia-laravel": "^1.3", - "intervention/image": "^2.7", + "intervention/image-laravel": "^1.3", "kalnoy/nestedset": "^6.0", "laravel/framework": "^10.48", "laravel/tinker": "^2.9", diff --git a/composer.lock b/composer.lock index f2064190..89379956 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": "9c6c80c4ca58e8a9cd192b4165a072f1", + "content-hash": "ae5fc294d1d05405e80b9a8d0ac72f64", "packages": [ { "name": "andreiio/blade-remix-icon", @@ -1913,51 +1913,179 @@ ], "time": "2024-06-13T01:25:09+00:00" }, + { + "name": "intervention/gif", + "version": "4.1.0", + "source": { + "type": "git", + "url": "https://github.com/Intervention/gif.git", + "reference": "3a2b5f8a8856e8877cdab5c47e51aab2d4cb23a3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Intervention/gif/zipball/3a2b5f8a8856e8877cdab5c47e51aab2d4cb23a3", + "reference": "3a2b5f8a8856e8877cdab5c47e51aab2d4cb23a3", + "shasum": "" + }, + "require": { + "php": "^8.1" + }, + "require-dev": { + "phpstan/phpstan": "^1", + "phpunit/phpunit": "^10.0", + "slevomat/coding-standard": "~8.0", + "squizlabs/php_codesniffer": "^3.8" + }, + "type": "library", + "autoload": { + "psr-4": { + "Intervention\\Gif\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Oliver Vogel", + "email": "oliver@intervention.io", + "homepage": "https://intervention.io/" + } + ], + "description": "Native PHP GIF Encoder/Decoder", + "homepage": "https://github.com/intervention/gif", + "keywords": [ + "animation", + "gd", + "gif", + "image" + ], + "support": { + "issues": "https://github.com/Intervention/gif/issues", + "source": "https://github.com/Intervention/gif/tree/4.1.0" + }, + "funding": [ + { + "url": "https://paypal.me/interventionio", + "type": "custom" + }, + { + "url": "https://github.com/Intervention", + "type": "github" + } + ], + "time": "2024-03-26T17:23:47+00:00" + }, { "name": "intervention/image", - "version": "2.7.2", + "version": "3.7.2", "source": { "type": "git", "url": "https://github.com/Intervention/image.git", - "reference": "04be355f8d6734c826045d02a1079ad658322dad" + "reference": "5451ff9f909c2fc836722e5ed6831b9f9a6db68c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Intervention/image/zipball/04be355f8d6734c826045d02a1079ad658322dad", - "reference": "04be355f8d6734c826045d02a1079ad658322dad", + "url": "https://api.github.com/repos/Intervention/image/zipball/5451ff9f909c2fc836722e5ed6831b9f9a6db68c", + "reference": "5451ff9f909c2fc836722e5ed6831b9f9a6db68c", "shasum": "" }, "require": { - "ext-fileinfo": "*", - "guzzlehttp/psr7": "~1.1 || ^2.0", - "php": ">=5.4.0" + "ext-mbstring": "*", + "intervention/gif": "^4.1", + "php": "^8.1" }, "require-dev": { - "mockery/mockery": "~0.9.2", - "phpunit/phpunit": "^4.8 || ^5.7 || ^7.5.15" + "mockery/mockery": "^1.6", + "phpstan/phpstan": "^1", + "phpunit/phpunit": "^10.0", + "slevomat/coding-standard": "~8.0", + "squizlabs/php_codesniffer": "^3.8" }, "suggest": { - "ext-gd": "to use GD library based image processing.", - "ext-imagick": "to use Imagick based image processing.", - "intervention/imagecache": "Caching extension for the Intervention Image library" + "ext-exif": "Recommended to be able to read EXIF data properly." }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.4-dev" + "autoload": { + "psr-4": { + "Intervention\\Image\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Oliver Vogel", + "email": "oliver@intervention.io", + "homepage": "https://intervention.io/" + } + ], + "description": "PHP image manipulation", + "homepage": "https://image.intervention.io/", + "keywords": [ + "gd", + "image", + "imagick", + "resize", + "thumbnail", + "watermark" + ], + "support": { + "issues": "https://github.com/Intervention/image/issues", + "source": "https://github.com/Intervention/image/tree/3.7.2" + }, + "funding": [ + { + "url": "https://paypal.me/interventionio", + "type": "custom" }, + { + "url": "https://github.com/Intervention", + "type": "github" + } + ], + "time": "2024-07-05T13:35:01+00:00" + }, + { + "name": "intervention/image-laravel", + "version": "1.3.0", + "source": { + "type": "git", + "url": "https://github.com/Intervention/image-laravel.git", + "reference": "24738a017d42a6fa8d9adabdbd69a2c19c5b0d30" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Intervention/image-laravel/zipball/24738a017d42a6fa8d9adabdbd69a2c19c5b0d30", + "reference": "24738a017d42a6fa8d9adabdbd69a2c19c5b0d30", + "shasum": "" + }, + "require": { + "illuminate/support": "^8|^9|^10|^11", + "intervention/image": "^3.7", + "php": "^8.1" + }, + "require-dev": { + "orchestra/testbench": "^8.18", + "phpunit/phpunit": "^10.0" + }, + "type": "library", + "extra": { "laravel": { "providers": [ - "Intervention\\Image\\ImageServiceProvider" + "Intervention\\Image\\Laravel\\ServiceProvider" ], "aliases": { - "Image": "Intervention\\Image\\Facades\\Image" + "Image": "Intervention\\Image\\Laravel\\Facades\\Image" } } }, "autoload": { "psr-4": { - "Intervention\\Image\\": "src/Intervention/Image" + "Intervention\\Image\\Laravel\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -1971,19 +2099,20 @@ "homepage": "https://intervention.io/" } ], - "description": "Image handling and manipulation library with support for Laravel integration", - "homepage": "http://image.intervention.io/", + "description": "Laravel Integration of Intervention Image", + "homepage": "https://image.intervention.io/", "keywords": [ "gd", "image", "imagick", "laravel", + "resize", "thumbnail", "watermark" ], "support": { - "issues": "https://github.com/Intervention/image/issues", - "source": "https://github.com/Intervention/image/tree/2.7.2" + "issues": "https://github.com/Intervention/image-laravel/issues", + "source": "https://github.com/Intervention/image-laravel/tree/1.3.0" }, "funding": [ { @@ -1995,7 +2124,7 @@ "type": "github" } ], - "time": "2022-05-21T17:30:32+00:00" + "time": "2024-06-15T08:20:20+00:00" }, { "name": "jean85/pretty-package-versions",