How can I resize image with a `.webp` extension? It is saving as `.jpg`.

I'm trying to resize an image with the .webp extension using FileUpload, but the file is being saved as .jpg instead. Here's the code I'm using to handle the file upload and resizing. Can anyone point out what I might be doing wrong?
FileUpload::make('medium')
->label('Medium Image')
->image()
->acceptedFileTypes(['image/webp'])
->imageResizeMode('cover')
->imageResizeTargetWidth(function (Get $get) {
$width = (10 / 100) * $get('width');
return $width;
})
->imageResizeTargetHeight(function (Get $get) {
$height = (10 / 100) * $get('height');
return $height;
})
->openable()
->downloadable()
->previewable()
->required()
->disk('s3')
->reactive()
->directory('media/cases/medium')
->hidden(function (Get $get) {
$height = $get('height');
$width = $get('width');

return ($height === 0 || $width === 0);
})
->maxSize(128),
FileUpload::make('medium')
->label('Medium Image')
->image()
->acceptedFileTypes(['image/webp'])
->imageResizeMode('cover')
->imageResizeTargetWidth(function (Get $get) {
$width = (10 / 100) * $get('width');
return $width;
})
->imageResizeTargetHeight(function (Get $get) {
$height = (10 / 100) * $get('height');
return $height;
})
->openable()
->downloadable()
->previewable()
->required()
->disk('s3')
->reactive()
->directory('media/cases/medium')
->hidden(function (Get $get) {
$height = $get('height');
$width = $get('width');

return ($height === 0 || $width === 0);
})
->maxSize(128),
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?