@@ -23,10 +23,10 @@ |
||
23 | 23 | |
24 | 24 | //.docx, .dotx, .xlsx, .xltx, .pptx, .potx, .ppsx |
25 | 25 | class MSOffice2007 extends Office { |
26 | - /** |
|
27 | - * {@inheritDoc} |
|
28 | - */ |
|
29 | - public function getMimeType(): string { |
|
30 | - return '/application\/vnd.openxmlformats-officedocument.*/'; |
|
31 | - } |
|
26 | + /** |
|
27 | + * {@inheritDoc} |
|
28 | + */ |
|
29 | + public function getMimeType(): string { |
|
30 | + return '/application\/vnd.openxmlformats-officedocument.*/'; |
|
31 | + } |
|
32 | 32 | } |
@@ -25,10 +25,10 @@ |
||
25 | 25 | |
26 | 26 | //.tiff |
27 | 27 | class TIFF extends Bitmap { |
28 | - /** |
|
29 | - * {@inheritDoc} |
|
30 | - */ |
|
31 | - public function getMimeType(): string { |
|
32 | - return '/image\/tiff/'; |
|
33 | - } |
|
28 | + /** |
|
29 | + * {@inheritDoc} |
|
30 | + */ |
|
31 | + public function getMimeType(): string { |
|
32 | + return '/image\/tiff/'; |
|
33 | + } |
|
34 | 34 | } |
@@ -23,10 +23,10 @@ |
||
23 | 23 | namespace OC\Preview; |
24 | 24 | |
25 | 25 | class BMP extends Image { |
26 | - /** |
|
27 | - * {@inheritDoc} |
|
28 | - */ |
|
29 | - public function getMimeType(): string { |
|
30 | - return '/image\/bmp/'; |
|
31 | - } |
|
26 | + /** |
|
27 | + * {@inheritDoc} |
|
28 | + */ |
|
29 | + public function getMimeType(): string { |
|
30 | + return '/image\/bmp/'; |
|
31 | + } |
|
32 | 32 | } |
@@ -25,10 +25,10 @@ |
||
25 | 25 | |
26 | 26 | //.ai |
27 | 27 | class Illustrator extends Bitmap { |
28 | - /** |
|
29 | - * {@inheritDoc} |
|
30 | - */ |
|
31 | - public function getMimeType(): string { |
|
32 | - return '/application\/illustrator/'; |
|
33 | - } |
|
28 | + /** |
|
29 | + * {@inheritDoc} |
|
30 | + */ |
|
31 | + public function getMimeType(): string { |
|
32 | + return '/application\/illustrator/'; |
|
33 | + } |
|
34 | 34 | } |
@@ -25,10 +25,10 @@ |
||
25 | 25 | |
26 | 26 | //.eps |
27 | 27 | class Postscript extends Bitmap { |
28 | - /** |
|
29 | - * {@inheritDoc} |
|
30 | - */ |
|
31 | - public function getMimeType(): string { |
|
32 | - return '/application\/postscript/'; |
|
33 | - } |
|
28 | + /** |
|
29 | + * {@inheritDoc} |
|
30 | + */ |
|
31 | + public function getMimeType(): string { |
|
32 | + return '/application\/postscript/'; |
|
33 | + } |
|
34 | 34 | } |
@@ -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(): string { |
|
29 | - return '/text\/(x-)?markdown/'; |
|
30 | - } |
|
25 | + /** |
|
26 | + * {@inheritDoc} |
|
27 | + */ |
|
28 | + public function getMimeType(): string { |
|
29 | + return '/text\/(x-)?markdown/'; |
|
30 | + } |
|
31 | 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(): string { |
|
30 | - return '/image\/gif/'; |
|
31 | - } |
|
26 | + /** |
|
27 | + * {@inheritDoc} |
|
28 | + */ |
|
29 | + public function getMimeType(): string { |
|
30 | + return '/image\/gif/'; |
|
31 | + } |
|
32 | 32 | } |
@@ -32,32 +32,32 @@ |
||
32 | 32 | |
33 | 33 | abstract class Image extends ProviderV2 { |
34 | 34 | |
35 | - /** |
|
36 | - * {@inheritDoc} |
|
37 | - */ |
|
38 | - public function getThumbnail(File $file, int $maxX, int $maxY): ?IImage { |
|
39 | - $maxSizeForImages = \OC::$server->getConfig()->getSystemValue('preview_max_filesize_image', 50); |
|
40 | - $size = $file->getSize(); |
|
35 | + /** |
|
36 | + * {@inheritDoc} |
|
37 | + */ |
|
38 | + public function getThumbnail(File $file, int $maxX, int $maxY): ?IImage { |
|
39 | + $maxSizeForImages = \OC::$server->getConfig()->getSystemValue('preview_max_filesize_image', 50); |
|
40 | + $size = $file->getSize(); |
|
41 | 41 | |
42 | - if ($maxSizeForImages !== -1 && $size > ($maxSizeForImages * 1024 * 1024)) { |
|
43 | - return null; |
|
44 | - } |
|
42 | + if ($maxSizeForImages !== -1 && $size > ($maxSizeForImages * 1024 * 1024)) { |
|
43 | + return null; |
|
44 | + } |
|
45 | 45 | |
46 | - $image = new \OC_Image(); |
|
46 | + $image = new \OC_Image(); |
|
47 | 47 | |
48 | - $fileName = $this->getLocalFile($file); |
|
48 | + $fileName = $this->getLocalFile($file); |
|
49 | 49 | |
50 | - $image->loadFromFile($fileName); |
|
51 | - $image->fixOrientation(); |
|
50 | + $image->loadFromFile($fileName); |
|
51 | + $image->fixOrientation(); |
|
52 | 52 | |
53 | - $this->cleanTmpFiles(); |
|
53 | + $this->cleanTmpFiles(); |
|
54 | 54 | |
55 | - if ($image->valid()) { |
|
56 | - $image->scaleDownToFit($maxX, $maxY); |
|
55 | + if ($image->valid()) { |
|
56 | + $image->scaleDownToFit($maxX, $maxY); |
|
57 | 57 | |
58 | - return $image; |
|
59 | - } |
|
60 | - return null; |
|
61 | - } |
|
58 | + return $image; |
|
59 | + } |
|
60 | + return null; |
|
61 | + } |
|
62 | 62 | |
63 | 63 | } |
@@ -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(): string { |
|
30 | - return '/image\/x-xbitmap/'; |
|
31 | - } |
|
26 | + /** |
|
27 | + * {@inheritDoc} |
|
28 | + */ |
|
29 | + public function getMimeType(): string { |
|
30 | + return '/image\/x-xbitmap/'; |
|
31 | + } |
|
32 | 32 | } |