Allow Disabling Auto Preview Generation While Keeping preview:generate-all Functionality

Hi everyone,

I have a specific use case that might be relevant to other performance-conscious users as well.

I would like to disable automatic preview generation during file uploads, because it creates significant CPU load—especially when many high-resolution images are uploaded during the day. However, I still want to generate all previews manually at night using the occ preview:generate-all command via cron when the server is idle.

Unfortunately, this isn’t currently possible with the following setup:

php

KopyalaDüzenle

'enable_previews' => true,
'enabledPreviewProviders' => [],

With this configuration:

  • :white_check_mark: No previews are generated during uploads (which is good)
  • :cross_mark: But preview:generate-all also doesn’t work at all (which defeats the purpose)

In contrast, if I provide preview providers like so:

php

KopyalaDüzenle

'enabledPreviewProviders' => [
  'OC\\Preview\\JPEG',
  'OC\\Preview\\PNG',
  'OC\\Preview\\GIF',
],

Then both upload-time previews and preview:generate-all start working—but again, preview generation happens during uploads, which I don’t want.

:plus: Proposed Improvement

Could we have a new config flag such as:

php

KopyalaDüzenle

'generate_previews_on_upload' => false,

This way we could:

  • Keep enable_previews = true so the UI displays them
  • Disable auto-generation during upload
  • Still allow scheduled bulk generation at night via cron (preview:generate-all)

This would be extremely helpful for users with limited CPU or shared hosting environments, especially photographers or media-heavy users.


Any suggestions or workarounds you’d recommend besides temporarily modifying config.php via scripting?
Thanks in advance!

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.