Skip to content

Commit

Permalink
Fix "fill-max" resize
Browse files Browse the repository at this point in the history
  • Loading branch information
ADmad committed Jan 26, 2024
1 parent 8078854 commit 4b0a0de
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Manipulators/Size.php
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ public function runFillResize(ImageInterface $image, $width, $height): ImageInte
*/
public function runFillMaxResize(ImageInterface $image, $width, $height): ImageInterface
{
$image = $image->resize($width, $height);
$image = $image->scale($width, $height);

return $image->resizeCanvas($width, $height, 'ffffff', 'center');
}
Expand Down
4 changes: 2 additions & 2 deletions tests/Manipulators/SizeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,9 @@ public function testRunResize()
$mock->shouldReceive('width')->andReturn(100)->times(4);
$mock->shouldReceive('height')->andReturn(100)->times(4);
$mock->shouldReceive('crop')->andReturn($mock)->once();
$mock->shouldReceive('resize')->with(100, 100)->andReturn($mock)->times(3);
$mock->shouldReceive('resize')->with(100, 100)->andReturn($mock)->times(2);
$mock->shouldReceive('scaleDown')->with(100, 100)->andReturn($mock)->times(2);
$mock->shouldReceive('scale')->with(100, 100)->andReturn($mock)->once();
$mock->shouldReceive('scale')->with(100, 100)->andReturn($mock)->times(2);
$mock->shouldReceive('resizeCanvas')->with(100, 100, 'ffffff', 'center')->andReturn($mock)->times(2);
});

Expand Down

0 comments on commit 4b0a0de

Please sign in to comment.