I recently set up Nextcloud, and so far I’m really enjoying it. With the exception of Gmail and Backblaze, I’m no longer using any online services that aren’t self-hosted on my own hardware; Nextcloud has allowed me to get rid of the last few Google services I was using.
One issue I’m having is that images I have uploaded to Nextcloud do not have thumbnails when the image size is large. My phone takes photos at 200MP, so this constitutes a significant number of my photos.
I’ve been researching the problem, and I think I need to set the following:
‘preview_max_x’ => null ‘preview_max_y’ => null ‘preview_max_filesize_image’ => -1 ‘preview_max_memory’ => -1
I’m running Nextcloud on a Proxmox hypervisor with 32 cores and 128GB of memory, so I’m not concerned about using system resources; I can always allocate more.
The issue I’m having is that I installed Nextcloud as a snap in Ubuntu Server. The last time I tried to use nextcloud.occ to change a configuration option, it set a string as an array, and triggered a bunch of php errors.
As far as I can tell, I need to do something like this:
sudo nextcloud.occ config:[something, maybe system]:set preview_max_x [some data goes here]
How do I format this so that nextcloud.occ inserts the variable into my php config properly? Any examples of a nextcloud.occ command would be very much appreciated.
Really, https://help.nextcloud.com/ is the correct place to ask questions like these. Or you could check the docs:
- https://docs.nextcloud.com/server/latest/admin_manual/configuration_files/previews_configuration.html
- https://docs.nextcloud.com/server/stable/admin_manual/configuration_server/occ_command.html
- https://docs.nextcloud.com/server/stable/admin_manual/configuration_server/config_sample_php_parameters.html?highlight=preview_max_x
- https://github.com/nextcloud/server/blob/master/config/config.sample.php
So it should be something like
sudo -u nextcloud /usr/bin/php /var/www/nextcloud.example.org/occ config:system:set preview_max_x --value="1500"
(worked for me, standard PHP install, you will have to adapt it for your snap-based install). Or you can insertpreview_max_x
directly at the root of your config.php as shown in nextcloud’s sample config file above.it set a string as an array, and triggered a bunch of php errors.
Always backup config.php.
Thanks! Adapting the command you gave to work with snap will be fairly easy. Regarding a backup of config.php, I’ve tried to do that, but with a snap install, I get a permission denied error when I try to enter the config directory, and you can’t “sudo cd.” I’ll try logging in as root or changing permissions.