50 Mb jpeg thumbnail limit

Nextcloud version (eg, 12.0.2): 14.0.6
Operating system and version (eg, Ubuntu 17.04): centos 7 latest
Apache or nginx version (eg, Apache 2.4.25): httpd-2.4.6-88.el7.centos.x86_64

PHP version (eg, 7.1):php-7.2.14-1.el7.remi.x86_64

The issue you are facing:

Image thumbnails won’t be generated if the jpg file is larger than 50mb.

Is this the first time you’ve seen this error? (Y/N):Y

Steps to replicate it:

  1. Upload any Jpg image larger than 50mb
  2. Wait for image to upload. (no preview)
  3. Ran occ thumbnail regenerate all command.

The output of your Nextcloud log in Admin > Logging:

|Error|gallery|Exception: Preview generation has failed|2019-01-16T10:24:42-0500|
|---|---|---|---|
|Error|gallery|OCP\Files\NotFoundException: |2019-01-16T10:24:42-0500|

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

<?php
$CONFIG = array (
  'instanceid' => '',
  'passwordsalt' => '',
  'secret' => '',
  'trusted_domains' =>
  array (
    0 => '',
  ),
  'datadirectory' => '/opt/nextcloud/',
  'overwrite.cli.url' => '',
  'dbtype' => 'mysql',
  'version' => '14.0.6.0',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => '',
  'dbpassword' => '',
  'installed' => true,
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'maintenance' => false,
  'theme' => '',
  'loglevel' => 2,
  'updater.secret' => '',
);

The output of your Apache/nginx/system log in /var/log/____:

There are no error messages in the apache logs.

Just in case anyone is interested. NextCloud sets a default size for its preview generation. Its limited to 50mb. This is why this issue was happening. When I searched for a solution I was always searching for thumbnail generation however the preview generator is what makes the thumbnails as well and applies this limit to both thubmnails and previews.

In order to fix this you can enter the preview size option of -1 to use unlimited previews.

Can you explain where you’re editing the preview size option? Presumably it’s the config.php which in my docker instance is under /config/www/nextcloud/config/config.php, but no line for preview size/preview allowing exists and I suspect I might need to enter the entire line manually. The nextcloud manual isn’t super useful here, so if that’s accurate and I’m on the right track I’d super appreciate the exact line I can copy/paste to make it where you are!

I have also the exact same problem that there are no preview files for pictures >50MB even if I set the following options in the config file:
‘preview_max_x’ => ‘null’,
‘preview_max_y’ => ‘null’,

Can someone explain what should be changed to make this work?

I know everyone hates bringing back an old thread, but this one is still a top web search result for the issue of setting the image thumbnail file size limit, and I wanted to close the discussion with more details on what worked for me.

As others have said, the default maximum limit for which NextCloud appears to create a preview image is 50MB (size of the original image). You can test this by uploading various images in the 40-60MB range, and only the ones with a file size less than 50MB will have a preview image generated.

It was mentioned above to use a config.php setting to change this, but the specific parameter name wasn’t provided.

NextCloud’s documentation on preview images doesn’t have a parameter listed for this file size limit, but thankfully OwnCloud documentation does (where NextCloud was originally forked from) and appears to work in the current version of NextCloud.

Use the configuration line

'preview_max_filesize_image' => 100,

where the integer you specify is the file size limit in MB of the original images for which you want to stop generating preview images. It does appear you can set this to “-1” for unlimited.