Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoachim Bauch <bauch@struktur.de>2021-12-16 11:17:11 +0300
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>2022-01-11 17:48:27 +0300
commit3ad763cf18597a6d8bf0c5ead66eb6805f5f1ab8 (patch)
treea1c19508994faa4de2f7711db6d81765d0b7ea72 /config/config.sample.php
parent2e61727e96883a9b8a1e80b4b59c7ae5e4ce2c78 (diff)
Prevent loading images that would require too much memory.
For most image formats, the header specifies the width/height. PHP allocates an image object from that size, even if the actual image data is much smaller. This image object size is not limited by the limit configured in PHP. The memory limit can be configured through "config.php" setting "preview_max_memory" and defaults to 128 MBytes which should be enough for most images without filling up all memory. Signed-off-by: Joachim Bauch <bauch@struktur.de>
Diffstat (limited to 'config/config.sample.php')
-rw-r--r--config/config.sample.php10
1 files changed, 10 insertions, 0 deletions
diff --git a/config/config.sample.php b/config/config.sample.php
index 72429b62d59..036bd69d34b 100644
--- a/config/config.sample.php
+++ b/config/config.sample.php
@@ -1024,6 +1024,16 @@ $CONFIG = [
'preview_max_filesize_image' => 50,
/**
+ * max memory for generating image previews with imagegd (default behavior)
+ * Reads the image dimensions from the header and assumes 32 bits per pixel.
+ * If creating the image would allocate more memory, preview generation will
+ * be disabled and the default mimetype icon is shown. Set to -1 for no limit.
+ *
+ * Defaults to ``128`` megabytes
+ */
+'preview_max_memory' => 128,
+
+/**
* custom path for LibreOffice/OpenOffice binary
*
*