From d47b84be67242960f6af5e8d16ea140e62a0933b Mon Sep 17 00:00:00 2001 From: "John Molakvoæ (skjnldsv)" Date: Fri, 22 Jan 2021 10:35:37 +0100 Subject: Add SGI and TGA preview support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: John Molakvoæ (skjnldsv) --- lib/private/Preview/SGI.php | 33 +++++++++++++++++++++++++++++++++ lib/private/Preview/TGA.php | 33 +++++++++++++++++++++++++++++++++ lib/private/PreviewManager.php | 4 +++- 3 files changed, 69 insertions(+), 1 deletion(-) create mode 100644 lib/private/Preview/SGI.php create mode 100644 lib/private/Preview/TGA.php (limited to 'lib') diff --git a/lib/private/Preview/SGI.php b/lib/private/Preview/SGI.php new file mode 100644 index 00000000000..2e198362670 --- /dev/null +++ b/lib/private/Preview/SGI.php @@ -0,0 +1,33 @@ + + * + * @author John Molakvoæ + * + * @license GNU AGPL version 3 or any later version + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ +namespace OC\Preview; + +//.sgi +class SGI extends Bitmap { + /** + * {@inheritDoc} + */ + public function getMimeType(): string { + return '/image\/sgi/'; + } +} diff --git a/lib/private/Preview/TGA.php b/lib/private/Preview/TGA.php new file mode 100644 index 00000000000..d29cb3e2c10 --- /dev/null +++ b/lib/private/Preview/TGA.php @@ -0,0 +1,33 @@ + + * + * @author John Molakvoæ + * + * @license GNU AGPL version 3 or any later version + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ +namespace OC\Preview; + +//.tga +class TGA extends Bitmap { + /** + * {@inheritDoc} + */ + public function getMimeType(): string { + return '/image\/t(ar)?ga/'; + } +} diff --git a/lib/private/PreviewManager.php b/lib/private/PreviewManager.php index 1d65da8ca59..d6dc700e4a2 100644 --- a/lib/private/PreviewManager.php +++ b/lib/private/PreviewManager.php @@ -4,7 +4,7 @@ * * @author Christoph Wurst * @author Joas Schilling - * @author John Molakvoæ (skjnldsv) + * @author John Molakvoæ * @author Julius Härtl * @author Morris Jobke * @author Olivier Paroz @@ -379,6 +379,8 @@ class PreviewManager implements IPreview { 'EPS' => ['mimetype' => '/application\/postscript/', 'class' => Preview\Postscript::class], 'TTF' => ['mimetype' => '/application\/(?:font-sfnt|x-font$)/', 'class' => Preview\Font::class], 'HEIC' => ['mimetype' => '/image\/hei(f|c)/', 'class' => Preview\HEIC::class], + 'TGA' => ['mimetype' => '/image\/t(ar)?ga/', 'class' => Preview\TGA::class], + 'SGI' => ['mimetype' => '/image\/sgi/', 'class' => Preview\SGI::class], ]; foreach ($imagickProviders as $queryFormat => $provider) { -- cgit v1.2.3 From 0bc9e3ca155a2be017039dde143fa590efba0c58 Mon Sep 17 00:00:00 2001 From: "John Molakvoæ (skjnldsv)" Date: Fri, 22 Jan 2021 10:43:32 +0100 Subject: Change license mail alias MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: John Molakvoæ (skjnldsv) --- .mailmap | 3 ++- lib/composer/composer/autoload_classmap.php | 2 ++ lib/composer/composer/autoload_static.php | 2 ++ resources/config/mimetypealiases.dist.json | 1 - 4 files changed, 6 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/.mailmap b/.mailmap index e0203ba1ebc..e4d268a28f0 100644 --- a/.mailmap +++ b/.mailmap @@ -358,7 +358,8 @@ Simon Birnbach Simon Könnecke Simon Whittaker Sjors van der Pluijm Sjors van der Pluijm -John Molakvoæ (skjnldsv) John Molakvoæ +John Molakvoæ John Molakvoæ +John Molakvoæ John Molakvoæ (skjnldsv) st3so Stefan Stefan Göckeritz diff --git a/lib/composer/composer/autoload_classmap.php b/lib/composer/composer/autoload_classmap.php index 6d93d8c1d51..673d5581042 100644 --- a/lib/composer/composer/autoload_classmap.php +++ b/lib/composer/composer/autoload_classmap.php @@ -1247,9 +1247,11 @@ return array( 'OC\\Preview\\Provider' => $baseDir . '/lib/private/Preview/Provider.php', 'OC\\Preview\\ProviderV1Adapter' => $baseDir . '/lib/private/Preview/ProviderV1Adapter.php', 'OC\\Preview\\ProviderV2' => $baseDir . '/lib/private/Preview/ProviderV2.php', + 'OC\\Preview\\SGI' => $baseDir . '/lib/private/Preview/SGI.php', 'OC\\Preview\\SVG' => $baseDir . '/lib/private/Preview/SVG.php', 'OC\\Preview\\StarOffice' => $baseDir . '/lib/private/Preview/StarOffice.php', 'OC\\Preview\\Storage\\Root' => $baseDir . '/lib/private/Preview/Storage/Root.php', + 'OC\\Preview\\TGA' => $baseDir . '/lib/private/Preview/TGA.php', 'OC\\Preview\\TIFF' => $baseDir . '/lib/private/Preview/TIFF.php', 'OC\\Preview\\TXT' => $baseDir . '/lib/private/Preview/TXT.php', 'OC\\Preview\\Watcher' => $baseDir . '/lib/private/Preview/Watcher.php', diff --git a/lib/composer/composer/autoload_static.php b/lib/composer/composer/autoload_static.php index 2b6aa27ea46..1ee50ae6b71 100644 --- a/lib/composer/composer/autoload_static.php +++ b/lib/composer/composer/autoload_static.php @@ -1276,9 +1276,11 @@ class ComposerStaticInit53792487c5a8370acc0b06b1a864ff4c 'OC\\Preview\\Provider' => __DIR__ . '/../../..' . '/lib/private/Preview/Provider.php', 'OC\\Preview\\ProviderV1Adapter' => __DIR__ . '/../../..' . '/lib/private/Preview/ProviderV1Adapter.php', 'OC\\Preview\\ProviderV2' => __DIR__ . '/../../..' . '/lib/private/Preview/ProviderV2.php', + 'OC\\Preview\\SGI' => __DIR__ . '/../../..' . '/lib/private/Preview/SGI.php', 'OC\\Preview\\SVG' => __DIR__ . '/../../..' . '/lib/private/Preview/SVG.php', 'OC\\Preview\\StarOffice' => __DIR__ . '/../../..' . '/lib/private/Preview/StarOffice.php', 'OC\\Preview\\Storage\\Root' => __DIR__ . '/../../..' . '/lib/private/Preview/Storage/Root.php', + 'OC\\Preview\\TGA' => __DIR__ . '/../../..' . '/lib/private/Preview/TGA.php', 'OC\\Preview\\TIFF' => __DIR__ . '/../../..' . '/lib/private/Preview/TIFF.php', 'OC\\Preview\\TXT' => __DIR__ . '/../../..' . '/lib/private/Preview/TXT.php', 'OC\\Preview\\Watcher' => __DIR__ . '/../../..' . '/lib/private/Preview/Watcher.php', diff --git a/resources/config/mimetypealiases.dist.json b/resources/config/mimetypealiases.dist.json index d02027619d6..9d0c070d1fa 100644 --- a/resources/config/mimetypealiases.dist.json +++ b/resources/config/mimetypealiases.dist.json @@ -105,7 +105,6 @@ "application/km": "mindmap", "application/x-freemind": "mindmap", "application/vnd.xmind.workbook": "mindmap", - "image/targa": "image/tga", "image/targa": "image/tga" } -- cgit v1.2.3