Previews / data size

Hi,

I have installed this extension to have a much quicker preview for my pictures on my ios devices. I started the process and it took days and suddenly stopped. NExtcloud was not reachable. So what happened is that in the nextcloud/data/preview folder there have been thousand of sub folders with a size of more than 50GB, That stopped NC working because no more space left.

I have a lot of pictures however I am not sure if I really need that amount of previews. Can someone help to find the right process to setup only the previews pictures for the nexcloud APP on IOS? Or do I really need all?

Thanks S

Fist of all you have to adjust what kind of previews you would like to have. I have had the same problem and have to setup my config.php as following to have only FullHD previews maximal (default is 4096):

  'enable_previews' => true,
    'enabledPreviewProviders' => 
    array (
      0 => 'OC\\Preview\\PNG',
      1 => 'OC\\Preview\\JPEG',
      2 => 'OC\\Preview\\GIF',
      3 => 'OC\\Preview\\BMP',
      4 => 'OC\\Preview\\XBitmap',
      5 => 'OC\\Preview\\Movie',
      6 => 'OC\\Preview\\PDF',
      7 => 'OC\\Preview\\MP3',
      8 => 'OC\\Preview\\TXT',
      9 => 'OC\\Preview\\MarkDown',
    ),
    'preview_max_x' => 1080,
    'preview_max_y' => 1920,

More about previews config is here: https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/config_sample_php_parameters.html#previews

After you change those settings you need to delete all files in preview folder and perform some DB cleanup and generate new previews. Here I open a ticket regarding documentation and solutions are listed there:

I wrote small script to put previews generation status into my NC Logs: How to know if Preview Generator is working?

Hi,

thanks a lot. I added the config you provided above into my config.php in the nextcloud folder restarted php and apache and deleted all files in the Preview Foler. Than excecuted:

sudo -u www-data php occ preview:delete_old

Then restarted the process with

sudo -u www-data php occ preview:generate-all

It starts to generate again the folder unders Preview. In each folder there is the preview of one image…See screenshot.

For what reason do I nee all those files? I just want to have a quick view in my IOS App.

Thanks S

And by the way it still generates much bigger files than in the config defined:

<?php
$CONFIG = array (
  'instanceid' => '***',
  'passwordsalt' => '**',
  'secret' => ***',
  'trusted_domains' => 
  array (
    0 => 'nextcloud.****',
  ),
  'datadirectory' => '/var/www/html/nextcloud/data',
  'dbtype' => 'mysql',
  'version' => '15.0.2.0',
  'overwrite.cli.url' => '*****',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost:3306',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'nextcloud',
  'dbpassword' => '***',
  'installed' => true,
  'memcache.distributed' => '\\OC\\Memcache\\Redis',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'redis' => array (
    'host' => '127.0.0.1',
    'port' => 6379,
  'enable_previews' => true,
    'enabledPreviewProviders' => 
    array (
      0 => 'OC\\Preview\\PNG',
      1 => 'OC\\Preview\\JPEG',
      2 => 'OC\\Preview\\GIF',
      3 => 'OC\\Preview\\BMP',
      4 => 'OC\\Preview\\XBitmap',
      5 => 'OC\\Preview\\Movie',
      6 => 'OC\\Preview\\PDF',
      7 => 'OC\\Preview\\MP3',
      8 => 'OC\\Preview\\TXT',
      9 => 'OC\\Preview\\MarkDown',
    ),
    'preview_max_x' => 1080,
    'preview_max_y' => 1920,

  ),
);

Basically you will have a lot of numbered sub folders in preview, each folder will contains few smaller previews of one picture in a different size. This will give you quicker pre generated previews in web and Client.

On your screenshot bigger file is marked as 753x511-max, so it is not even 1920x1080. Or what you means?

Hi,

thanks a lot for your quick answer. Yes that example was not good as the picture itself is below 19201080.
For the high Res pictures it’s still 4096

Maybe any mistake in the config? I used the config.php in the config folder.

Thanks S

This is correct one

Have you delete something here? Because it is one ), too much at the end.

Hi,

Have you delete something here? Because it is one ), too much at the end

No I have deleted nothing but added the config in the wrong place. After the ,(komma) not before and now it seems doing it in the right way. Thanks

I have also executed these commands to limit the number of previews.

./occ config:app:set --value="32 64 1024"  previewgenerator squareSizes
./occ config:app:set --value="64 128 1024" previewgenerator widthSizes
./occ config:app:set --value="64 256 1024" previewgenerator heightSizes

But this did change anything

Thanks

S

1 Like