Replace InterventionImage::read with InterventionImage::decodePath for image processing
This commit is contained in:
@@ -9,7 +9,7 @@ final readonly class ResizeCommandHandler
|
||||
{
|
||||
public function resize(Storage $storage, int $width, int $height): Storage
|
||||
{
|
||||
$image = InterventionImage::read($storage->path);
|
||||
$image = InterventionImage::decodePath($storage->path);
|
||||
if ($image->width() < $width && $image->height() < $height) {
|
||||
return $storage;
|
||||
}
|
||||
@@ -23,7 +23,7 @@ final readonly class ResizeCommandHandler
|
||||
|
||||
public function width(Storage $storage, int $width): Storage
|
||||
{
|
||||
$image = InterventionImage::read($storage->path);
|
||||
$image = InterventionImage::decodePath($storage->path);
|
||||
if ($image->width() < $width) {
|
||||
return $storage;
|
||||
}
|
||||
@@ -37,7 +37,7 @@ final readonly class ResizeCommandHandler
|
||||
|
||||
public function height(Storage $storage, int $height): Storage
|
||||
{
|
||||
$image = InterventionImage::read($storage->path);
|
||||
$image = InterventionImage::decodePath($storage->path);
|
||||
if ($image->height() < $height) {
|
||||
return $storage;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user