nextcloud / previewgenerator

Nextcloud app to do preview generation in the background.
https://apps.nextcloud.com/apps/previewgenerator
GNU Affero General Public License v3.0
450 stars 56 forks source link

Settings for preview sizes are ignored #298

Open Demian98 opened 2 years ago

Demian98 commented 2 years ago

I used the commands from the documentation to generate previews just for some specific sizes:

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

Here is a screenshot from the database: grafik

Then I followed the instructions to delete the existing previews and regenerate:

  1. Remove the your-nextcloud-data-directory/appdata_*/preview directory
  2. run occ files:scan-app-data
  3. Regenerate with occ preview:generate-all

But these settings have no effect. I still get previews in many sizes up to 4096 after running the occ preview:generate-all.

Please let me know what I'm doing wrong, every help or hint is welcome :)

janusn commented 1 year ago

Those 3 settings only affect the these commands you run manually occ preview:generate-all and occ preview:pre-generate. They do not affect the preview when a user click on the image.

The only way to limit preview always is listed on the second step of the very last part of the readme.md, i.e. I want to reset/regenerate all previews.

Optional: change parameters preview_max_x and preview_max_y in config.php (e.g., to 512), and change the previewgenerator app parameters heightSizes, squareSizes and widthSizes as per the README (or better yet, to a low value each, e.g. 512, 256 and 512 respectively)

Furthermore, previewgenerator only generates 4 sizes, 64, 256, 1024 and 4096. Ref: patch ce10f8b

Even worse, from my experience, NC never returns a preview less than 1024 anyway. The only meaningful sizes to be pregenerated are 1024 and 4096.