# Previews / data size

**URL:** <https://help.nextcloud.com/t/previews-data-size/46990>\
**Category:** ℹ️ Support\
**Tags:** previewgenerator-app\
**Created:** [February 6, 2019, 9:09am UTC](https://help.nextcloud.com/t/previews-data-size/46990 "2019-02-06T09:09:45Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![s25a](https://help.nextcloud.com/letter_avatar/s25a/32/6_22734026db12803ebb3e059622ac3534.png) [@s25a](https://help.nextcloud.com/u/s25a)\
**Post date:** [February 6, 2019, 9:09am UTC](https://help.nextcloud.com/t/previews-data-size/46990/1 "2019-02-06T09:09:45Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![gas85](https://help.nextcloud.com/user_avatar/help.nextcloud.com/gas85/32/7772_2.png) [@gas85](https://help.nextcloud.com/u/gas85)\
**Post date:** [February 6, 2019, 11:06am UTC](https://help.nextcloud.com/t/previews-data-size/46990/2 "2019-02-06T11:06:46Z")

</div>

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](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:

> <https://github.com/nextcloud/documentation/issues/919#issuecomment-436551118>
>
> Hello,
> by surfing in tickets I seen one new for me command - occ files:scan-app-data, unfortunately it is documented nowhere.
> Regards!

I wrote small script to put previews generation status into my NC Logs: [How to know if Preview Generator is working?](https://help.nextcloud.com/t/how-to-know-if-preview-generator-is-working/41072/6)

---

<div class="post-metadata">

**Author:** ![s25a](https://help.nextcloud.com/letter_avatar/s25a/32/6_22734026db12803ebb3e059622ac3534.png) [@s25a](https://help.nextcloud.com/u/s25a)\
**Post date:** [February 6, 2019, 1:58pm UTC](https://help.nextcloud.com/t/previews-data-size/46990/3 "2019-02-06T13:58:11Z")

</div>

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.

 ![4](https://help.nextcloud.com/uploads/default/original/2X/3/3ad2a5b82755a9ee0f330603addff13754e7c2ef.jpeg)

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,

  ),
);

```

---

<div class="post-metadata">

**Author:** ![gas85](https://help.nextcloud.com/user_avatar/help.nextcloud.com/gas85/32/7772_2.png) [@gas85](https://help.nextcloud.com/u/gas85)\
**Post date:** [February 6, 2019, 2:27pm UTC](https://help.nextcloud.com/t/previews-data-size/46990/4 "2019-02-06T14:27:47Z")

</div>

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.

> [@s25a](#):
>
> And by the way it still generates much bigger files than in the config defined:

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

---

<div class="post-metadata">

**Author:** ![s25a](https://help.nextcloud.com/letter_avatar/s25a/32/6_22734026db12803ebb3e059622ac3534.png) [@s25a](https://help.nextcloud.com/u/s25a)\
**Post date:** [February 6, 2019, 2:43pm UTC](https://help.nextcloud.com/t/previews-data-size/46990/5 "2019-02-06T14:43:11Z")

</div>

Hi,

thanks a lot for your quick answer. Yes that example was not good as the picture itself is below 1920_1080.  
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

---

<div class="post-metadata">

**Author:** ![gas85](https://help.nextcloud.com/user_avatar/help.nextcloud.com/gas85/32/7772_2.png) [@gas85](https://help.nextcloud.com/u/gas85)\
**Post date:** [February 6, 2019, 2:51pm UTC](https://help.nextcloud.com/t/previews-data-size/46990/6 "2019-02-06T14:51:56Z")

</div>

> [@s25a](#):
>
> I used the config.php in the config folder.

This is correct one

> [@s25a](#):
>
> ```
> 'preview_max_x' => 1080,
> 'preview_max_y' => 1920,
> 
> ```
> 
> ),  
> );

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

---

<div class="post-metadata">

**Author:** ![s25a](https://help.nextcloud.com/letter_avatar/s25a/32/6_22734026db12803ebb3e059622ac3534.png) [@s25a](https://help.nextcloud.com/u/s25a)\
**Post date:** [February 6, 2019, 5:02pm UTC](https://help.nextcloud.com/t/previews-data-size/46990/7 "2019-02-06T17:02:18Z")

</div>

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.

```auto
./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

---

<div class="post-metadata">

**Author:** ![wwe](https://help.nextcloud.com/user_avatar/help.nextcloud.com/wwe/32/72963_2.png) [@wwe](https://help.nextcloud.com/u/wwe)\
**Post date:** [December 4, 2024, 9:16am UTC](https://help.nextcloud.com/t/previews-data-size/46990/8 "2024-12-04T09:16:19Z")

</div>



---

<div class="post-metadata">

**Author:** ![wwe](https://help.nextcloud.com/user_avatar/help.nextcloud.com/wwe/32/72963_2.png) [@wwe](https://help.nextcloud.com/u/wwe)\
**Post date:** [December 11, 2024, 2:23pm UTC](https://help.nextcloud.com/t/previews-data-size/46990/9 "2024-12-11T14:23:40Z")

</div>


