mirror of
https://github.com/koel/koel
synced 2024-11-10 06:34:14 +00:00
feat: use webp by default, falling back to jpeg (#1574)
This commit is contained in:
parent
28b9a55453
commit
4854e56fdb
1 changed files with 6 additions and 1 deletions
|
@ -3,6 +3,7 @@
|
|||
namespace App\Services;
|
||||
|
||||
use Intervention\Image\Constraint;
|
||||
use Intervention\Image\Exception\NotSupportedException;
|
||||
use Intervention\Image\ImageManager;
|
||||
|
||||
class ImageWriter
|
||||
|
@ -31,6 +32,10 @@ class ImageWriter
|
|||
$img->blur($config['blur']);
|
||||
}
|
||||
|
||||
$img->save($destination, $config['quality'] ?? self::DEFAULT_QUALITY);
|
||||
try {
|
||||
$img->save($destination, $config['quality'] ?? self::DEFAULT_QUALITY, 'webp');
|
||||
} catch (NotSupportedException) {
|
||||
$img->save($destination, $config['quality'] ?? self::DEFAULT_QUALITY);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue