diff options
-rw-r--r-- | config/config.sample.php | 4 | ||||
-rw-r--r-- | lib/private/legacy/OC_Image.php | 6 | ||||
-rw-r--r-- | tests/lib/ImageTest.php | 4 |
3 files changed, 7 insertions, 7 deletions
diff --git a/config/config.sample.php b/config/config.sample.php index a74f03b5cc7..bc38a9f5444 100644 --- a/config/config.sample.php +++ b/config/config.sample.php @@ -1171,9 +1171,9 @@ $CONFIG = [ * 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 + * Defaults to ``256`` megabytes */ -'preview_max_memory' => 128, +'preview_max_memory' => 256, /** * custom path for LibreOffice/OpenOffice binary diff --git a/lib/private/legacy/OC_Image.php b/lib/private/legacy/OC_Image.php index 9ccc6409ba0..d2faae9e24d 100644 --- a/lib/private/legacy/OC_Image.php +++ b/lib/private/legacy/OC_Image.php @@ -50,8 +50,8 @@ use OCP\IImage; */ class OC_Image implements \OCP\IImage { - // Default memory limit for images to load (128 MBytes). - protected const DEFAULT_MEMORY_LIMIT = 128; + // Default memory limit for images to load (256 MBytes). + protected const DEFAULT_MEMORY_LIMIT = 256; // Default quality for jpeg images protected const DEFAULT_JPEG_QUALITY = 80; @@ -585,7 +585,7 @@ class OC_Image implements \OCP\IImage { // Assume 32 bits per pixel. if ($width * $height * 4 > $memory_limit * 1024 * 1024) { - $this->logger->debug('Image size of ' . $width . 'x' . $height . ' would exceed allowed memory limit of ' . $memory_limit); + $this->logger->info('Image size of ' . $width . 'x' . $height . ' would exceed allowed memory limit of ' . $memory_limit . '. You may increase the preview_max_memory in your config.php if you need previews of this image.'); return false; } diff --git a/tests/lib/ImageTest.php b/tests/lib/ImageTest.php index 2a753b01550..f4da0275c2d 100644 --- a/tests/lib/ImageTest.php +++ b/tests/lib/ImageTest.php @@ -144,8 +144,8 @@ class ImageTest extends \Test\TestCase { ->willReturn(null); $config->expects($this->once()) ->method('getSystemValueInt') - ->with('preview_max_memory', 128) - ->willReturn(128); + ->with('preview_max_memory', 256) + ->willReturn(256); $img = new \OC_Image(null, null, $config); $img->loadFromFile(OC::$SERVERROOT.'/tests/data/testimage.jpg'); $raw = imagecreatefromstring(file_get_contents(OC::$SERVERROOT.'/tests/data/testimage.jpg')); |