summaryrefslogtreecommitdiffstats
path: root/lib/private/Preview
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2020-04-05 11:00:57 +0200
committerJulius Härtl <jus@bitgrid.net>2020-04-08 16:24:10 +0200
commita2e671c489528a935c7a4e186188f84ea2b3058e (patch)
tree49ed1c4503facd90d2dd767ac3d3b85c7ec98de7 /lib/private/Preview
parent0734582c062da9dad11562c68730d4e752b08acd (diff)
downloadnextcloud-server-a2e671c489528a935c7a4e186188f84ea2b3058e.tar.gz
nextcloud-server-a2e671c489528a935c7a4e186188f84ea2b3058e.zip
Extract preview from opendocument files
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'lib/private/Preview')
-rw-r--r--lib/private/Preview/OpenDocument.php17
1 files changed, 16 insertions, 1 deletions
diff --git a/lib/private/Preview/OpenDocument.php b/lib/private/Preview/OpenDocument.php
index b795441d837..1db7b0be521 100644
--- a/lib/private/Preview/OpenDocument.php
+++ b/lib/private/Preview/OpenDocument.php
@@ -25,11 +25,26 @@
namespace OC\Preview;
//.odt, .ott, .oth, .odm, .odg, .otg, .odp, .otp, .ods, .ots, .odc, .odf, .odb, .odi, .oxt
-class OpenDocument extends Office {
+use OCP\Files\File;
+use OCP\IImage;
+
+class OpenDocument extends Bundled {
/**
* {@inheritDoc}
*/
public function getMimeType(): string {
return '/application\/vnd.oasis.opendocument.*/';
}
+
+
+ /**
+ * @inheritDoc
+ */
+ public function getThumbnail(File $file, int $maxX, int $maxY): ?IImage {
+ $image = $this->extractThumbnail($file, 'Thumbnails/thumbnail.png');
+ if ($image->valid()) {
+ return $image;
+ }
+ return null;
+ }
}