2021-01-17 15:09:31 -05:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
2021-06-04 15:52:51 -04:00
|
|
|
|
2021-01-17 15:09:31 -05:00
|
|
|
/**
|
2024-05-23 03:26:56 -04:00
|
|
|
* SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors
|
|
|
|
|
* SPDX-License-Identifier: AGPL-3.0-or-later
|
2021-01-17 15:09:31 -05:00
|
|
|
*/
|
|
|
|
|
namespace OC\Preview;
|
|
|
|
|
|
|
|
|
|
use OCP\Files\FileInfo;
|
|
|
|
|
|
|
|
|
|
class WebP extends Image {
|
|
|
|
|
/**
|
|
|
|
|
* {@inheritDoc}
|
|
|
|
|
*/
|
|
|
|
|
public function getMimeType(): string {
|
|
|
|
|
return '/image\/webp/';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function isAvailable(FileInfo $file): bool {
|
2021-02-11 05:31:38 -05:00
|
|
|
return (bool)(imagetypes() & IMG_WEBP);
|
2021-01-17 15:09:31 -05:00
|
|
|
}
|
|
|
|
|
}
|