0
0
mirror of https://github.com/nextcloud/server.git synced 2024-11-14 12:26:49 +00:00
nextcloud_server/lib/private/Preview/Krita.php
Andy Scherzinger dae7c159f7
chore: Add SPDX header
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
2024-05-24 13:11:22 +02:00

35 lines
710 B
PHP

<?php
/**
* SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OC\Preview;
use OCP\Files\File;
use OCP\IImage;
class Krita extends Bundled {
/**
* {@inheritDoc}
*/
public function getMimeType(): string {
return '/application\/x-krita/';
}
/**
* @inheritDoc
*/
public function getThumbnail(File $file, int $maxX, int $maxY): ?IImage {
$image = $this->extractThumbnail($file, 'mergedimage.png');
if (($image !== null) && $image->valid()) {
return $image;
}
$image = $this->extractThumbnail($file, 'preview.png');
if (($image !== null) && $image->valid()) {
return $image;
}
return null;
}
}