[Pkg-owncloud-commits] [owncloud] 07/20: backport b68098ebbaaa3bd816d24c1ed304425e838ee6b8 to stable6

David Prévot taffit at moszumanska.debian.org
Tue Apr 29 17:37:54 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository owncloud.

commit a3d93f0ba113944299db1c4d2d61f9d010d038c7
Author: Georg Ehrke <developer at georgehrke.com>
Date:   Mon Apr 28 12:05:10 2014 +0200

    backport b68098ebbaaa3bd816d24c1ed304425e838ee6b8 to stable6
---
 lib/private/preview/office-fallback.php | 143 --------------------------------
 lib/private/preview/office.php          |   6 --
 2 files changed, 149 deletions(-)

diff --git a/lib/private/preview/office-fallback.php b/lib/private/preview/office-fallback.php
deleted file mode 100644
index f184b31..0000000
--- a/lib/private/preview/office-fallback.php
+++ /dev/null
@@ -1,143 +0,0 @@
-<?php
-/**
- * Copyright (c) 2013 Georg Ehrke georg at ownCloud.com
- * This file is licensed under the Affero General Public License version 3 or
- * later.
- * See the COPYING-README file.
- */
-namespace OC\Preview;
-
-/* //There is no (good) php-only solution for converting 2003 word documents to pdfs / pngs ...
-class DOC extends Provider {
-
-	public function getMimeType() {
-		return '/application\/msword/';
-	}
-
-	public function getThumbnail($path, $maxX, $maxY, $scalingup, $fileview) {
-		require_once('');
-	}
-
-}
-
-\OC\Preview::registerProvider('OC\Preview\DOC');
-*/
-
-class DOCX extends Provider {
-
-	public function getMimeType() {
-		return '/application\/vnd.openxmlformats-officedocument.wordprocessingml.document/';
-	}
-
-	public function getThumbnail($path, $maxX, $maxY, $scalingup, $fileview) {
-		require_once('phpdocx/classes/TransformDoc.inc');
-
-		$tmpDoc = $fileview->toTmpFile($path);
-
-		$transformdoc = new \TransformDoc();
-		$transformdoc->setStrFile($tmpDoc);
-		$transformdoc->generatePDF($tmpDoc);
-
-		$pdf = new \imagick($tmpDoc . '[0]');
-		$pdf->setImageFormat('jpg');
-
-		unlink($tmpDoc);
-
-		$image = new \OC_Image($pdf);
-
-		return $image->valid() ? $image : false;
-	}
-
-}
-
-\OC\Preview::registerProvider('OC\Preview\DOCX');
-
-class MSOfficeExcel extends Provider {
-
-	public function getMimeType() {
-		return null;
-	}
-
-	public function getThumbnail($path, $maxX, $maxY, $scalingup, $fileview) {
-		require_once('PHPExcel/Classes/PHPExcel.php');
-		require_once('PHPExcel/Classes/PHPExcel/IOFactory.php');
-
-		$absPath = $fileview->toTmpFile($path);
-		$tmpPath = \OC_Helper::tmpFile();
-
-		$rendererName = \PHPExcel_Settings::PDF_RENDERER_DOMPDF;
-		$rendererLibraryPath = \OC::$THIRDPARTYROOT . '/3rdparty/dompdf';
-
-		\PHPExcel_Settings::setPdfRenderer($rendererName, $rendererLibraryPath);
-
-		$phpexcel = new \PHPExcel($absPath);
-		$excel = \PHPExcel_IOFactory::createWriter($phpexcel, 'PDF');
-		$excel->save($tmpPath);
-
-		$pdf = new \imagick($tmpPath . '[0]');
-		$pdf->setImageFormat('jpg');
-
-		unlink($absPath);
-		unlink($tmpPath);
-
-		$image = new \OC_Image();
-		$image->loadFromData($pdf);
-
-		return $image->valid() ? $image : false;
-	}
-
-}
-
-class XLS extends MSOfficeExcel {
-
-	public function getMimeType() {
-		return '/application\/vnd.ms-excel/';
-	}
-
-}
-
-\OC\Preview::registerProvider('OC\Preview\XLS');
-
-class XLSX extends MSOfficeExcel {
-
-	public function getMimeType() {
-		return '/application\/vnd.openxmlformats-officedocument.spreadsheetml.sheet/';
-	}
-
-}
-
-\OC\Preview::registerProvider('OC\Preview\XLSX');
-
-/* //There is no (good) php-only solution for converting powerpoint documents to pdfs / pngs ...
-class MSOfficePowerPoint extends Provider {
-
-	public function getMimeType() {
-		return null;
-	}
-
-	public function getThumbnail($path, $maxX, $maxY, $scalingup, $fileview) {
-		return false;
-	}
-
-}
-
-class PPT extends MSOfficePowerPoint {
-
-	public function getMimeType() {
-		return '/application\/vnd.ms-powerpoint/';
-	}
-
-}
-
-\OC\Preview::registerProvider('OC\Preview\PPT');
-
-class PPTX extends MSOfficePowerPoint {
-
-	public function getMimeType() {
-		return '/application\/vnd.openxmlformats-officedocument.presentationml.presentation/';
-	}
-
-}
-
-\OC\Preview::registerProvider('OC\Preview\PPTX');
-*/
\ No newline at end of file
diff --git a/lib/private/preview/office.php b/lib/private/preview/office.php
index 7a4826c..15e2428 100644
--- a/lib/private/preview/office.php
+++ b/lib/private/preview/office.php
@@ -18,12 +18,6 @@ if (extension_loaded('imagick')) {
 		//let's see if there is libreoffice or openoffice on this machine
 		if($isShellExecEnabled && ($isLibreOfficeAvailable || $isOpenOfficeAvailable || is_string(\OC_Config::getValue('preview_libreoffice_path', null)))) {
 			require_once('office-cl.php');
-		}else{
-			//in case there isn't, use our fallback
-			require_once('office-fallback.php');
 		}
-	} else {
-		//in case there isn't, use our fallback
-		require_once('office-fallback.php');
 	}
 }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git



More information about the Pkg-owncloud-commits mailing list