Skip to content

Commit c72fc90

Browse files
committed
add .webp extension
1 parent 6544e06 commit c72fc90

4 files changed

Lines changed: 4 additions & 4 deletions

File tree

Helpers/File.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public function __construct(private SplFileInfo $file,private TranslatorInterfac
2222
* @return array|false|string
2323
*/
2424
public function getDimension(): bool|array|string {
25-
return preg_match('/(gif|png|jpe?g|svg)$/i', $this->file->getExtension()) ?
25+
return preg_match('/(gif|png|jpe?g|svg|webp)$/i', $this->file->getExtension()) ?
2626
@getimagesize($this->file->getPathname()) : '';
2727
}
2828

Resources/doc/book/1-basic-configuration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ artgris_file_manager:
9898

9999
`media`: `/\.(mp4|ogg|webm)$/i` Accept basic HTML video media types (.mp4, .ogg and .webm)
100100

101-
`image:`: `/\.(gif|png|jpe?g|svg)$/i` Accept basic HTML image types (.gif, .png, .jpg, .jpeg and .svg)
101+
`image:`: `/\.(gif|png|jpe?g|svg|webp)$/i` Accept basic HTML image types (.gif, .png, .jpg, .jpeg, .svg and webp)
102102

103103
`file`: `/.+$/i` Accept all files with an extension (.pdf, .html, ...)
104104

Resources/public/libs/blueimp-file-upload/js/jquery.fileupload-image.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@
121121
options: {
122122
// The regular expression for the types of images to load:
123123
// matched against the file type:
124-
loadImageFileTypes: /^image\/(gif|jpeg|png|svg\+xml)$/,
124+
loadImageFileTypes: /^image\/(gif|jpeg|png|webp|svg\+xml)$/,
125125
// The maximum file size of images to load:
126126
loadImageMaxFileSize: 10000000, // 10MB
127127
// The maximum width of resized images:

Service/FileTypeService.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public function fileIcon(string $filePath,?string $extension = null, ?int $size
8484
case preg_match('/(mp3|wav)$/i', $extension):
8585
$fa = 'far fa-file-audio';
8686
break;
87-
case preg_match('/(gif|png|jpe?g|svg)$/i', $extension):
87+
case preg_match('/(gif|png|jpe?g|svg|webp)$/i', $extension):
8888

8989
$fileName = $filePath;
9090
if ($cachebreaker) {

0 commit comments

Comments
 (0)