2020-04-05 05:01:40 -04:00
|
|
|
<?php
|
2025-06-30 09:04:05 -04:00
|
|
|
|
2020-04-05 05:01:40 -04:00
|
|
|
/**
|
2024-05-23 03:26:56 -04:00
|
|
|
* SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors
|
|
|
|
|
* SPDX-License-Identifier: AGPL-3.0-or-later
|
2020-04-05 05:01:40 -04:00
|
|
|
*/
|
|
|
|
|
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');
|
2022-02-24 08:42:55 -05:00
|
|
|
if (($image !== null) && $image->valid()) {
|
2020-04-05 05:01:40 -04:00
|
|
|
return $image;
|
|
|
|
|
}
|
|
|
|
|
$image = $this->extractThumbnail($file, 'preview.png');
|
2022-02-24 08:42:55 -05:00
|
|
|
if (($image !== null) && $image->valid()) {
|
2020-04-05 05:01:40 -04:00
|
|
|
return $image;
|
|
|
|
|
}
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
}
|