Spotter-VM/seeddms/docker/srv/seeddms/previewers.patch

48 lines
4.4 KiB
Diff

diff -ruN orig/SeedDMS/Preview/PdfPreviewer.php pear/SeedDMS/Preview/PdfPreviewer.php
--- orig/SeedDMS/Preview/PdfPreviewer.php 2017-12-15 08:23:09.000000000 +0100
+++ pear/SeedDMS/Preview/PdfPreviewer.php 2018-01-04 09:55:06.117665300 +0100
@@ -27,12 +27,17 @@
function __construct($previewDir, $timeout=5) { /* {{{ */
parent::__construct($previewDir, $timeout);
$this->converters = array(
- 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' => "unoconv -d document -f pdf --stdout -v '%f' > '%o'",
- 'application/vnd.oasis.opendocument.text' => "unoconv -d document -f pdf --stdout -v '%f' > '%o'",
'text/rtf' => "unoconv -d document -f pdf --stdout -v '%f' > '%o'",
'application/msword' => "unoconv -d document -f pdf --stdout -v '%f' > '%o'",
- 'application/vnd.ms-excel' => "unoconv -d document -f pdf --stdout -v '%f' > '%o'",
- 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' => "unoconv -d document -f pdf --stdout -v '%f' > '%o'",
+ 'application/vnd.oasis.opendocument.text' => "unoconv -d document -f pdf --stdout -v '%f' > '%o'",
+ 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' => "unoconv -d document -f pdf --stdout -v '%f' > '%o'",
+ 'application/vnd.ms-excel' => "unoconv -d spreadsheet -f pdf --stdout -v '%f' > '%o'",
+ 'application/vnd.oasis.opendocument.spreadsheet' => "unoconv -d spreadsheet -f pdf --stdout -v '%f' > '%o'",
+ 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' => "unoconv -d spreadsheet -f pdf --stdout -v '%f' > '%o'",
+ 'application/vnd.ms-powerpoint' => "unoconv -d presentation -f pdf --stdout -v '%f' > '%o'",
+ 'application/vnd.oasis.opendocument.presentation' => "unoconv -d presentation -f pdf --stdout -v '%f' > '%o'",
+ 'application/vnd.openxmlformats-officedocument.presentationml.presentation' => "unoconv -d presentation -f pdf --stdout -v '%f' > '%o'",
+ 'text/html' => "unoconv -d document -f pdf --stdout -v '%f' > '%o'",
'text/plain' => "unoconv -d document -f pdf --stdout -v '%f' > '%o'",
'application/postscript' => "ps2pdf '%f' - > '%o'",
'image/jpeg' => "convert '%f' pdf:- > '%o'",
diff -ruN orig/SeedDMS/Preview/Previewer.php pear/SeedDMS/Preview/Previewer.php
--- orig/SeedDMS/Preview/Previewer.php 2017-12-15 08:23:09.000000000 +0100
+++ pear/SeedDMS/Preview/Previewer.php 2018-01-04 09:56:12.359902000 +0100
@@ -41,6 +41,18 @@
'application/pdf' => "convert -density 100 -resize %wx '%f[0]' '%o'",
'application/postscript' => "convert -density 100 -resize %wx '%f[0]' '%o'",
'application/x-compressed-tar' => "tar tzvf '%f' | convert -density 100 -resize %wx text:-[0] '%o'",
+ 'text/rtf' => "unoconv -d document -e PageRange=1-1 -f pdf --stdout '%f' | convert -resize %wx pdf:- '%o'",
+ 'application/msword' => "unoconv -d document -e PageRange=1-1 -f pdf --stdout '%f' | convert -resize %wx pdf:- '%o'",
+ 'application/vnd.oasis.opendocument.text' => "unoconv -d document -e PageRange=1-1 -f pdf --stdout '%f' | convert -resize %wx pdf:- '%o'",
+ 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' => "unoconv -d document -e PageRange=1-1 -f pdf --stdout '%f' | convert -resize %wx pdf:- '%o'",
+ 'application/vnd.ms-excel' => "unoconv -d spreadsheet -e PageRange=1-1 -f pdf --stdout '%f' | convert -resize %wx pdf:- '%o'",
+ 'application/vnd.oasis.opendocument.spreadsheet' => "unoconv -d spreadsheet -e PageRange=1-1 -f pdf --stdout '%f' | convert -resize %wx pdf:- '%o'",
+ 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' => "unoconv -d spreadsheet -e PageRange=1-1 -f pdf --stdout '%f' | convert -resize %wx pdf:- '%o'",
+ 'application/vnd.ms-powerpoint' => "unoconv -d presentation -e PageRange=1-1 -f pdf --stdout '%f' | convert -resize %wx pdf:- '%o'",
+ 'application/vnd.oasis.opendocument.presentation' => "unoconv -d presentation -e PageRange=1-1 -f pdf --stdout '%f' | convert -resize %wx pdf:- '%o'",
+ 'application/vnd.openxmlformats-officedocument.presentationml.presentation' => "unoconv -d presentation -e PageRange=1-1 -f pdf --stdout '%f' | convert -resize %wx pdf:- '%o'",
+ 'text/html' => "unoconv -d document -e PageRange=1-1 -f pdf --stdout '%f' | convert -resize %wx pdf:- '%o'",
+ 'text/plain' => "unoconv -d document -e PageRange=1-1 -f pdf --stdout '%f' | convert -resize %wx pdf:- '%o'",
);
$this->width = intval($width);
} /* }}} */