diff options
author | Georg Ehrke <developer@georgehrke.com> | 2015-01-19 00:22:55 +0100 |
---|---|---|
committer | Georg Ehrke <developer@georgehrke.com> | 2015-01-22 20:21:37 +0100 |
commit | 3af8bde949ee14360574ec504be80a01ccd466ea (patch) | |
tree | 7cd9298277ad8cda79d146d31e60005281733a78 /lib | |
parent | 9cef90da981336a907a9ca7f9b511e25b7be8a90 (diff) | |
download | nextcloud-server-3af8bde949ee14360574ec504be80a01ccd466ea.tar.gz nextcloud-server-3af8bde949ee14360574ec504be80a01ccd466ea.zip |
add config-option for an image's maximum filesize when generating previews
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/preview/image.php | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/private/preview/image.php b/lib/private/preview/image.php index 986a44b48fd..e8473ebb8a4 100644 --- a/lib/private/preview/image.php +++ b/lib/private/preview/image.php @@ -26,6 +26,13 @@ class Image extends Provider { return false; } + $maxSizeForImages = \OC::$server->getConfig()->getSystemValue('preview_max_filesize_image', 50); + $size = $fileInfo->getSize(); + + if ($maxSizeForImages !== -1 && $size > ($maxSizeForImages * 1024 * 1024)) { + return false; + } + $image = new \OC_Image(); if($fileInfo['encrypted'] === true) { |