@@ -23,10 +23,10 @@ |
||
23 | 23 | namespace OC\Preview; |
24 | 24 | |
25 | 25 | class XBitmap extends Image { |
26 | - /** |
|
27 | - * {@inheritDoc} |
|
28 | - */ |
|
29 | - public function getMimeType() { |
|
30 | - return '/image\/x-xbitmap/'; |
|
31 | - } |
|
26 | + /** |
|
27 | + * {@inheritDoc} |
|
28 | + */ |
|
29 | + public function getMimeType() { |
|
30 | + return '/image\/x-xbitmap/'; |
|
31 | + } |
|
32 | 32 | } |
@@ -23,10 +23,10 @@ |
||
23 | 23 | namespace OC\Preview; |
24 | 24 | |
25 | 25 | class GIF extends Image { |
26 | - /** |
|
27 | - * {@inheritDoc} |
|
28 | - */ |
|
29 | - public function getMimeType() { |
|
30 | - return '/image\/gif/'; |
|
31 | - } |
|
26 | + /** |
|
27 | + * {@inheritDoc} |
|
28 | + */ |
|
29 | + public function getMimeType() { |
|
30 | + return '/image\/gif/'; |
|
31 | + } |
|
32 | 32 | } |
@@ -22,11 +22,11 @@ |
||
22 | 22 | namespace OC\Preview; |
23 | 23 | |
24 | 24 | class MarkDown extends TXT { |
25 | - /** |
|
26 | - * {@inheritDoc} |
|
27 | - */ |
|
28 | - public function getMimeType() { |
|
29 | - return '/text\/(x-)?markdown/'; |
|
30 | - } |
|
25 | + /** |
|
26 | + * {@inheritDoc} |
|
27 | + */ |
|
28 | + public function getMimeType() { |
|
29 | + return '/text\/(x-)?markdown/'; |
|
30 | + } |
|
31 | 31 | |
32 | 32 | } |
@@ -23,10 +23,10 @@ |
||
23 | 23 | namespace OC\Preview; |
24 | 24 | |
25 | 25 | class JPEG extends Image { |
26 | - /** |
|
27 | - * {@inheritDoc} |
|
28 | - */ |
|
29 | - public function getMimeType() { |
|
30 | - return '/image\/jpeg/'; |
|
31 | - } |
|
26 | + /** |
|
27 | + * {@inheritDoc} |
|
28 | + */ |
|
29 | + public function getMimeType() { |
|
30 | + return '/image\/jpeg/'; |
|
31 | + } |
|
32 | 32 | } |
@@ -23,10 +23,10 @@ |
||
23 | 23 | |
24 | 24 | //.sxw, .stw, .sxc, .stc, .sxd, .std, .sxi, .sti, .sxg, .sxm |
25 | 25 | class StarOffice extends Office { |
26 | - /** |
|
27 | - * {@inheritDoc} |
|
28 | - */ |
|
29 | - public function getMimeType() { |
|
30 | - return '/application\/vnd.sun.xml.*/'; |
|
31 | - } |
|
26 | + /** |
|
27 | + * {@inheritDoc} |
|
28 | + */ |
|
29 | + public function getMimeType() { |
|
30 | + return '/application\/vnd.sun.xml.*/'; |
|
31 | + } |
|
32 | 32 | } |
@@ -35,58 +35,58 @@ |
||
35 | 35 | */ |
36 | 36 | class GeneratorHelper { |
37 | 37 | |
38 | - /** @var IRootFolder */ |
|
39 | - private $rootFolder; |
|
38 | + /** @var IRootFolder */ |
|
39 | + private $rootFolder; |
|
40 | 40 | |
41 | - public function __construct(IRootFolder $rootFolder) { |
|
42 | - $this->rootFolder = $rootFolder; |
|
43 | - } |
|
41 | + public function __construct(IRootFolder $rootFolder) { |
|
42 | + $this->rootFolder = $rootFolder; |
|
43 | + } |
|
44 | 44 | |
45 | - /** |
|
46 | - * @param IProvider $provider |
|
47 | - * @param File $file |
|
48 | - * @param int $maxWidth |
|
49 | - * @param int $maxHeight |
|
50 | - * @return bool|IImage |
|
51 | - */ |
|
52 | - public function getThumbnail(IProvider $provider, File $file, $maxWidth, $maxHeight) { |
|
53 | - list($view, $path) = $this->getViewAndPath($file); |
|
54 | - return $provider->getThumbnail($path, $maxWidth, $maxHeight, false, $view); |
|
55 | - } |
|
45 | + /** |
|
46 | + * @param IProvider $provider |
|
47 | + * @param File $file |
|
48 | + * @param int $maxWidth |
|
49 | + * @param int $maxHeight |
|
50 | + * @return bool|IImage |
|
51 | + */ |
|
52 | + public function getThumbnail(IProvider $provider, File $file, $maxWidth, $maxHeight) { |
|
53 | + list($view, $path) = $this->getViewAndPath($file); |
|
54 | + return $provider->getThumbnail($path, $maxWidth, $maxHeight, false, $view); |
|
55 | + } |
|
56 | 56 | |
57 | - /** |
|
58 | - * @param File $file |
|
59 | - * @return array |
|
60 | - * This is required to create the old view and path |
|
61 | - */ |
|
62 | - private function getViewAndPath(File $file) { |
|
63 | - $absPath = ltrim($file->getPath(), '/'); |
|
64 | - $owner = explode('/', $absPath)[0]; |
|
57 | + /** |
|
58 | + * @param File $file |
|
59 | + * @return array |
|
60 | + * This is required to create the old view and path |
|
61 | + */ |
|
62 | + private function getViewAndPath(File $file) { |
|
63 | + $absPath = ltrim($file->getPath(), '/'); |
|
64 | + $owner = explode('/', $absPath)[0]; |
|
65 | 65 | |
66 | - $userFolder = $this->rootFolder->getUserFolder($owner)->getParent(); |
|
66 | + $userFolder = $this->rootFolder->getUserFolder($owner)->getParent(); |
|
67 | 67 | |
68 | - $nodes = $userFolder->getById($file->getId()); |
|
69 | - $file = $nodes[0]; |
|
68 | + $nodes = $userFolder->getById($file->getId()); |
|
69 | + $file = $nodes[0]; |
|
70 | 70 | |
71 | - $view = new View($userFolder->getPath()); |
|
72 | - $path = $userFolder->getRelativePath($file->getPath()); |
|
71 | + $view = new View($userFolder->getPath()); |
|
72 | + $path = $userFolder->getRelativePath($file->getPath()); |
|
73 | 73 | |
74 | - return [$view, $path]; |
|
75 | - } |
|
74 | + return [$view, $path]; |
|
75 | + } |
|
76 | 76 | |
77 | - /** |
|
78 | - * @param ISimpleFile $maxPreview |
|
79 | - * @return IImage |
|
80 | - */ |
|
81 | - public function getImage(ISimpleFile $maxPreview) { |
|
82 | - return new img($maxPreview->getContent()); |
|
83 | - } |
|
77 | + /** |
|
78 | + * @param ISimpleFile $maxPreview |
|
79 | + * @return IImage |
|
80 | + */ |
|
81 | + public function getImage(ISimpleFile $maxPreview) { |
|
82 | + return new img($maxPreview->getContent()); |
|
83 | + } |
|
84 | 84 | |
85 | - /** |
|
86 | - * @param $provider |
|
87 | - * @return IProvider |
|
88 | - */ |
|
89 | - public function getProvider($provider) { |
|
90 | - return $provider(); |
|
91 | - } |
|
85 | + /** |
|
86 | + * @param $provider |
|
87 | + * @return IProvider |
|
88 | + */ |
|
89 | + public function getProvider($provider) { |
|
90 | + return $provider(); |
|
91 | + } |
|
92 | 92 | } |
@@ -23,10 +23,10 @@ |
||
23 | 23 | |
24 | 24 | //.doc, .dot |
25 | 25 | class MSOfficeDoc extends Office { |
26 | - /** |
|
27 | - * {@inheritDoc} |
|
28 | - */ |
|
29 | - public function getMimeType() { |
|
30 | - return '/application\/msword/'; |
|
31 | - } |
|
26 | + /** |
|
27 | + * {@inheritDoc} |
|
28 | + */ |
|
29 | + public function getMimeType() { |
|
30 | + return '/application\/msword/'; |
|
31 | + } |
|
32 | 32 | } |
@@ -24,10 +24,10 @@ |
||
24 | 24 | |
25 | 25 | // .otf, .ttf and .pfb |
26 | 26 | class Font extends Bitmap { |
27 | - /** |
|
28 | - * {@inheritDoc} |
|
29 | - */ |
|
30 | - public function getMimeType() { |
|
31 | - return '/application\/(?:font-sfnt|x-font$)/'; |
|
32 | - } |
|
27 | + /** |
|
28 | + * {@inheritDoc} |
|
29 | + */ |
|
30 | + public function getMimeType() { |
|
31 | + return '/application\/(?:font-sfnt|x-font$)/'; |
|
32 | + } |
|
33 | 33 | } |
34 | 34 | \ No newline at end of file |
@@ -25,10 +25,10 @@ |
||
25 | 25 | |
26 | 26 | //.eps |
27 | 27 | class Postscript extends Bitmap { |
28 | - /** |
|
29 | - * {@inheritDoc} |
|
30 | - */ |
|
31 | - public function getMimeType() { |
|
32 | - return '/application\/postscript/'; |
|
33 | - } |
|
28 | + /** |
|
29 | + * {@inheritDoc} |
|
30 | + */ |
|
31 | + public function getMimeType() { |
|
32 | + return '/application\/postscript/'; |
|
33 | + } |
|
34 | 34 | } |