Skip to content
Snippets Groups Projects
Commit 1f52ad03 authored by Georg Ehrke's avatar Georg Ehrke
Browse files

work on powerpoint fallback

parent 228e084e
Branches
No related tags found
No related merge requests found
...@@ -59,7 +59,6 @@ class MSOfficeExcel extends Provider { ...@@ -59,7 +59,6 @@ class MSOfficeExcel extends Provider {
public function getThumbnail($path, $maxX, $maxY, $scalingup, $fileview) { public function getThumbnail($path, $maxX, $maxY, $scalingup, $fileview) {
require_once('PHPExcel/Classes/PHPExcel.php'); require_once('PHPExcel/Classes/PHPExcel.php');
require_once('PHPExcel/Classes/PHPExcel/IOFactory.php'); require_once('PHPExcel/Classes/PHPExcel/IOFactory.php');
//require_once('mpdf/mpdf.php');
$abspath = $fileview->toTmpFile($path); $abspath = $fileview->toTmpFile($path);
$tmppath = \OC_Helper::tmpFile(); $tmppath = \OC_Helper::tmpFile();
...@@ -113,14 +112,12 @@ class MSOfficePowerPoint extends Provider { ...@@ -113,14 +112,12 @@ class MSOfficePowerPoint extends Provider {
} }
public function getThumbnail($path, $maxX, $maxY, $scalingup, $fileview) { public function getThumbnail($path, $maxX, $maxY, $scalingup, $fileview) {
//require_once(''); return false;
//require_once('');
$abspath = $fileview->toTmpFile($path); $abspath = $fileview->toTmpFile($path);
$tmppath = \OC_Helper::tmpFile(); $tmppath = \OC_Helper::tmpFile();
$excel = PHPPowerPoint_IOFactory::createWriter($abspath, 'PDF'); null;
$excel->save($tmppath);
$pdf = new \imagick($tmppath . '[0]'); $pdf = new \imagick($tmppath . '[0]');
$pdf->setImageFormat('jpg'); $pdf->setImageFormat('jpg');
...@@ -128,6 +125,8 @@ class MSOfficePowerPoint extends Provider { ...@@ -128,6 +125,8 @@ class MSOfficePowerPoint extends Provider {
unlink($abspath); unlink($abspath);
unlink($tmppath); unlink($tmppath);
$image = new \OC_Image($pdf);
return $image->valid() ? $image : false; return $image->valid() ? $image : false;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment