Skip to content

Commit

Permalink
Update LaravelThumbnail.php
Browse files Browse the repository at this point in the history
Update some functions to work with Intervention\Image v3
  • Loading branch information
hungnm1518 authored Apr 26, 2024
1 parent 5d9a0ea commit 6d3fe68
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/LaravelThumbnail.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use Illuminate\Support\Facades\File;
use Illuminate\Support\Facades\Storage;
use Intervention\Image\Facades\Image;
use Intervention\Image\Laravel\Facades\Image;

class LaravelThumbnail
{
Expand Down Expand Up @@ -73,7 +73,7 @@ public static function generate($image, $width = null, $height = null, $type = '
}

// if thumbnail do not exist, we make it
$image = Image::make($imageFileFullPath);
$image = Image::read($imageFileFullPath);

switch ($type) {
case 'fit':
Expand All @@ -96,8 +96,8 @@ public static function generate($image, $width = null, $height = null, $type = '
});
}
case 'resizeCanvas':
{
$image->resizeCanvas($width, $height, 'center', false, 'rgba(0, 0, 0, 0)'); // gets the center part
{
$image->resizeCanvas($width, $height, 'ff0', 'center'); // gets the center part
}
}

Expand Down

0 comments on commit 6d3fe68

Please sign in to comment.