Skip to content

Commit

Permalink
Fix bug where image path was not set correctly (#24)
Browse files Browse the repository at this point in the history
  • Loading branch information
physixc authored Jan 26, 2024
1 parent b031c90 commit fe1ea81
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/Actions/ResizeImage.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,11 @@ public function resize(Asset $asset, ?int $width = null, ?int $height = null): v

// Prevents exceptions occurring when resizing non-compatible filetypes like SVG.
try {
$path = $asset->resolvedPath();
$orientedImage = Image::make($path)->orientate();
$orientedImage = Image::make($asset->resolvedPath())->orientate();

$image = (new Size())->runMaxResize($orientedImage, $width, $height);

$asset->disk()->filesystem()->put($path, $image->encode());
$asset->disk()->filesystem()->put($asset->path(), $image->encode());

$asset->merge(['image-optimized' => '1']);

Expand Down

0 comments on commit fe1ea81

Please sign in to comment.