2014-11-28 03:20:58 -05:00
|
|
|
<?php
|
2024-05-23 03:26:56 -04:00
|
|
|
|
2014-11-28 03:20:58 -05:00
|
|
|
/**
|
2024-05-23 03:26:56 -04:00
|
|
|
* SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
|
|
|
|
|
* SPDX-FileCopyrightText: 2016 ownCloud, Inc.
|
|
|
|
|
* SPDX-License-Identifier: AGPL-3.0-only
|
2014-11-28 03:20:58 -05:00
|
|
|
*/
|
|
|
|
|
namespace OC\Preview;
|
|
|
|
|
|
|
|
|
|
//.odt, .ott, .oth, .odm, .odg, .otg, .odp, .otp, .ods, .ots, .odc, .odf, .odb, .odi, .oxt
|
2020-04-05 05:00:57 -04:00
|
|
|
use OCP\Files\File;
|
|
|
|
|
use OCP\IImage;
|
|
|
|
|
|
|
|
|
|
class OpenDocument extends Bundled {
|
2014-11-28 03:20:58 -05:00
|
|
|
/**
|
|
|
|
|
* {@inheritDoc}
|
|
|
|
|
*/
|
2019-06-04 09:25:25 -04:00
|
|
|
public function getMimeType(): string {
|
2014-11-28 03:20:58 -05:00
|
|
|
return '/application\/vnd.oasis.opendocument.*/';
|
|
|
|
|
}
|
2020-04-05 05:00:57 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @inheritDoc
|
|
|
|
|
*/
|
|
|
|
|
public function getThumbnail(File $file, int $maxX, int $maxY): ?IImage {
|
|
|
|
|
$image = $this->extractThumbnail($file, 'Thumbnails/thumbnail.png');
|
2022-02-24 08:42:55 -05:00
|
|
|
if (($image !== null) && $image->valid()) {
|
2020-04-05 05:00:57 -04:00
|
|
|
return $image;
|
|
|
|
|
}
|
|
|
|
|
return null;
|
|
|
|
|
}
|
2014-11-28 03:20:58 -05:00
|
|
|
}
|