@@ -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 | } |
@@ -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 | } |
@@ -42,7 +42,7 @@ |
||
42 | 42 | |
43 | 43 | $content = stream_get_contents($fileview->fopen($path, 'r')); |
44 | 44 | if (substr($content, 0, 5) !== '<?xml') { |
45 | - $content = '<?xml version="1.0" encoding="UTF-8" standalone="no"?>' . $content; |
|
45 | + $content = '<?xml version="1.0" encoding="UTF-8" standalone="no"?>'.$content; |
|
46 | 46 | } |
47 | 47 | |
48 | 48 | // Do not parse SVG files with references |
@@ -27,50 +27,50 @@ |
||
27 | 27 | use OCP\ILogger; |
28 | 28 | |
29 | 29 | class SVG extends Provider { |
30 | - /** |
|
31 | - * {@inheritDoc} |
|
32 | - */ |
|
33 | - public function getMimeType() { |
|
34 | - return '/image\/svg\+xml/'; |
|
35 | - } |
|
30 | + /** |
|
31 | + * {@inheritDoc} |
|
32 | + */ |
|
33 | + public function getMimeType() { |
|
34 | + return '/image\/svg\+xml/'; |
|
35 | + } |
|
36 | 36 | |
37 | - /** |
|
38 | - * {@inheritDoc} |
|
39 | - */ |
|
40 | - public function getThumbnail($path, $maxX, $maxY, $scalingup, $fileview) { |
|
41 | - try { |
|
42 | - $svg = new \Imagick(); |
|
43 | - $svg->setBackgroundColor(new \ImagickPixel('transparent')); |
|
37 | + /** |
|
38 | + * {@inheritDoc} |
|
39 | + */ |
|
40 | + public function getThumbnail($path, $maxX, $maxY, $scalingup, $fileview) { |
|
41 | + try { |
|
42 | + $svg = new \Imagick(); |
|
43 | + $svg->setBackgroundColor(new \ImagickPixel('transparent')); |
|
44 | 44 | |
45 | - $content = stream_get_contents($fileview->fopen($path, 'r')); |
|
46 | - if (substr($content, 0, 5) !== '<?xml') { |
|
47 | - $content = '<?xml version="1.0" encoding="UTF-8" standalone="no"?>' . $content; |
|
48 | - } |
|
45 | + $content = stream_get_contents($fileview->fopen($path, 'r')); |
|
46 | + if (substr($content, 0, 5) !== '<?xml') { |
|
47 | + $content = '<?xml version="1.0" encoding="UTF-8" standalone="no"?>' . $content; |
|
48 | + } |
|
49 | 49 | |
50 | - // Do not parse SVG files with references |
|
51 | - if (stripos($content, 'xlink:href') !== false) { |
|
52 | - return false; |
|
53 | - } |
|
50 | + // Do not parse SVG files with references |
|
51 | + if (stripos($content, 'xlink:href') !== false) { |
|
52 | + return false; |
|
53 | + } |
|
54 | 54 | |
55 | - $svg->readImageBlob($content); |
|
56 | - $svg->setImageFormat('png32'); |
|
57 | - } catch (\Exception $e) { |
|
58 | - \OC::$server->getLogger()->logException($e, [ |
|
59 | - 'level' => ILogger::ERROR, |
|
60 | - 'app' => 'core', |
|
61 | - ]); |
|
62 | - return false; |
|
63 | - } |
|
55 | + $svg->readImageBlob($content); |
|
56 | + $svg->setImageFormat('png32'); |
|
57 | + } catch (\Exception $e) { |
|
58 | + \OC::$server->getLogger()->logException($e, [ |
|
59 | + 'level' => ILogger::ERROR, |
|
60 | + 'app' => 'core', |
|
61 | + ]); |
|
62 | + return false; |
|
63 | + } |
|
64 | 64 | |
65 | - //new image object |
|
66 | - $image = new \OC_Image(); |
|
67 | - $image->loadFromData($svg); |
|
68 | - //check if image object is valid |
|
69 | - if ($image->valid()) { |
|
70 | - $image->scaleDownToFit($maxX, $maxY); |
|
65 | + //new image object |
|
66 | + $image = new \OC_Image(); |
|
67 | + $image->loadFromData($svg); |
|
68 | + //check if image object is valid |
|
69 | + if ($image->valid()) { |
|
70 | + $image->scaleDownToFit($maxX, $maxY); |
|
71 | 71 | |
72 | - return $image; |
|
73 | - } |
|
74 | - return false; |
|
75 | - } |
|
72 | + return $image; |
|
73 | + } |
|
74 | + return false; |
|
75 | + } |
|
76 | 76 | } |
@@ -22,15 +22,15 @@ |
||
22 | 22 | namespace OC\Share20; |
23 | 23 | |
24 | 24 | class Hooks { |
25 | - public static function post_deleteUser($arguments) { |
|
26 | - \OC::$server->getShareManager()->userDeleted($arguments['uid']); |
|
27 | - } |
|
25 | + public static function post_deleteUser($arguments) { |
|
26 | + \OC::$server->getShareManager()->userDeleted($arguments['uid']); |
|
27 | + } |
|
28 | 28 | |
29 | - public static function post_deleteGroup($arguments) { |
|
30 | - \OC::$server->getShareManager()->groupDeleted($arguments['gid']); |
|
31 | - } |
|
29 | + public static function post_deleteGroup($arguments) { |
|
30 | + \OC::$server->getShareManager()->groupDeleted($arguments['gid']); |
|
31 | + } |
|
32 | 32 | |
33 | - public static function post_removeFromGroup($arguments) { |
|
34 | - \OC::$server->getShareManager()->userDeletedFromGroup($arguments['uid'], $arguments['gid']); |
|
35 | - } |
|
33 | + public static function post_removeFromGroup($arguments) { |
|
34 | + \OC::$server->getShareManager()->userDeletedFromGroup($arguments['uid'], $arguments['gid']); |
|
35 | + } |
|
36 | 36 | } |