blob: 2e77c7befd2c37bf8c76e160eacbfc91c624cb1e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
<?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;
}
}
|