Regenerate existing previews with new dimensions

Nextcloud version: 23.0.0
Operating system and version: Debian 11 "Bullseye"
Apache or nginx version: Apache 2.4.51-1~deb11u1
PHP version: 8.0.14

The issue you are facing:

I was generating previes for a couple of pictures without having a limit on the preview size (now set to 1200px). They are now really huge and still take a couple of seconds to load on a slow internet connection. I would like to delete the old previews and let it generate new ones - how would I go about doing this?

I think I found a way… in the table oc_filecache identify the previews you want to regenerate, note their fileid. Then remove that row and also remove the folder with the fileid that is located in the data_directory/appdata/preview/*/*/*/*/*/*/*/fileid, the stars representing some sort of hash? Havent figured out where that comes from.

I will probably write a short bash script to automate that… not very elegant, but works. I also encountered cases where I would need to rescan the files to make them appear in nextcloud again… not ideal.

You do not need to write any script. Simply: