Skip to content

Commit

Permalink
build(deps): bump intervention/image from 2.7.2 to 3.7.2 (#784)
Browse files Browse the repository at this point in the history
* 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](Intervention/image@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] <support@github.com>

* upgrade to intervention/image v3

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Andrei Ioniță <hi@andrei.io>
  • Loading branch information
dependabot[bot] and andreiio authored Aug 2, 2024
1 parent 83519d0 commit 55a68ca
Show file tree
Hide file tree
Showing 5 changed files with 162 additions and 37 deletions.
3 changes: 2 additions & 1 deletion app/Http/Controllers/Admin/SettingController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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()),
}
Expand Down
4 changes: 2 additions & 2 deletions app/Models/Media.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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(),
Expand Down
13 changes: 4 additions & 9 deletions app/Providers/MediaServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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);

Expand All @@ -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);
}),
]);
}
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
177 changes: 153 additions & 24 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 55a68ca

Please sign in to comment.