WebP.php 435 B

123456789101112131415161718192021222324
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors
  5. * SPDX-License-Identifier: AGPL-3.0-or-later
  6. */
  7. namespace OC\Preview;
  8. use OCP\Files\FileInfo;
  9. class WebP extends Image {
  10. /**
  11. * {@inheritDoc}
  12. */
  13. public function getMimeType(): string {
  14. return '/image\/webp/';
  15. }
  16. public function isAvailable(FileInfo $file): bool {
  17. return (bool)(imagetypes() & IMG_WEBP);
  18. }
  19. }