Skip to content

Commit

Permalink
Add image formats to filesystem adapter
Browse files Browse the repository at this point in the history
  • Loading branch information
daun committed Oct 26, 2024
1 parent 447e603 commit 4f1e917
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Filesystem/AbstractAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public function isImage($path)
{
return in_array(
strtolower($this->extension($path)),
['jpg', 'jpeg', 'png', 'gif']
['jpg', 'jpeg', 'png', 'gif', 'webp', 'avif']
);
}

Expand Down
2 changes: 1 addition & 1 deletion tests/Imaging/ImageValidatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public function it_checks_if_image_has_valid_extension_and_mimetype()
]]);

// We'll test `isValidExtension()` functionality separately below, and just mock here...
ImageValidator::shouldReceive('isValidExtension')->andReturnTrue()->times(23);
ImageValidator::shouldReceive('isValidExtension')->andReturnTrue()->times(24);
ImageValidator::makePartial();

$this->assertTrue(ImageValidator::isValidImage('jpg', 'image/jpeg'));
Expand Down

0 comments on commit 4f1e917

Please sign in to comment.