# Fairly new with nextcloud but preview folder has huge size

**URL:** <https://help.nextcloud.com/t/fairly-new-with-nextcloud-but-preview-folder-has-huge-size/64390>\
**Category:** ℹ️ Support\
**Created:** [November 18, 2019, 12:34pm UTC](https://help.nextcloud.com/t/fairly-new-with-nextcloud-but-preview-folder-has-huge-size/64390 "2019-11-18T12:34:00Z")\
**Posts on this page:** 1\
**Showing post:** 3

<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:** [November 18, 2019, 2:09pm UTC](https://help.nextcloud.com/t/fairly-new-with-nextcloud-but-preview-folder-has-huge-size/64390/3 "2019-11-18T14:09:13Z")

</div>

Hey, check this out regarding config this:  
[https://ownyourbits.com/2019/06/29/understanding-and-improving-nextcloud-previews/](https://ownyourbits.com/2019/06/29/understanding-and-improving-nextcloud-previews/)

and this

> [@Previews / data size](https://help.nextcloud.com/t/previews-data-size/46990/2):
>
> 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\\…

And remember, after you change the config, you have to regenerate previews again. Here is a good explanation how:

> <https://github.com/nextcloud/previewgenerator/issues/94>
>
> Hi!
> 
> \#### Say I apply these settings
> \`\`\`sh
> sudo -u www-data php /var/www/nex…tcloud/occ config:app:set --value="64 128" previewgenerator squareSizes
> sudo -u www-data php /var/www/nextcloud/occ config:app:set --value="64 128" previewgenerator widthSizes
> sudo -u www-data php /var/www/nextcloud/occ config:app:set --value="64 128" previewgenerator heightSizes
> \`\`\`
> \#### And my \`config.php\` has
> \`\`\`php
> 'preview\_max\_x' =\> 2048,
> 'preview\_max\_y' =\> 2048,
> 'preview\_max\_scale\_factor' =\> 2,
> \`\`\`
> OR
> \`\`\`php
> 'preview\_max\_x' =\> null,
> 'preview\_max\_y' =\> null,
> 'preview\_max\_scale\_factor' =\> 2,
> \`\`\`
> \#### And then I run \`generate-all\`
> Would the generator set the \`'\_max'\` file to 128 pixels only and then just use that size as maximum even when I click to open an image? Or is just for pre-generating and nothing else and then the bigger image will be generated when clicked? I am but confused because I got some mixed results here, but I am guessing the browser cache was doing its thing.
> 
> What would be the recommended settings for a big install with lots of images?
> We want to be able to browse it fast and have the best full-screen experience, but we would like to avoid having 30+Gb (still processing) of preview images data (which also goes to the backup, btw).
> 
> And then there is also the question if it is safe to remove the preview files and/or folders to reclaim that space, which I already asked on core. https://github.com/nextcloud/server/issues/5263#issuecomment-355202378
> 
> I would probably prefer to make some simple bash scripting to remove just some bigger sized PNGs so I don't have to reprocess everything. That is easy if there is no problem with the database and other stuff.
> 
> In any case, because I was testing different configs as well, I can see many different preview images above 1024px for some files, which is probably the reason for such a big footprint.
> 
> I would prefer to have just the smaller sizes pre-generated (for menus and icons) and let the big stuff be done as needed. Can this be done with the config above?
> 
> \#### Edit 
> Also, what does \`pre-generate\` really do? It runs in 1s and does not seem to create any files here. \`generate-all\` scans everything (for days) and sucks the processor and creates the pngs, but \`pre-generate\` does not seem to do anything.

---

_[View the full topic](https://help.nextcloud.com/t/fairly-new-with-nextcloud-but-preview-folder-has-huge-size/64390)._
