nextcloud / nextcloud/previewgenerator

Limit the generated image dimension combinations

Open
#529 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

0. to triage bug needs info
Dominant language
PHP
Stars
520
Forks
55
PR merge metrics
No merged PRs in 30d

Description

How to use GitHub
  • Please use the 👍 reaction to show that you are interested into the same feature.
  • Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
  • Subscribe to receive notifications on status change and new comments.

Feature request

**Which Nextcloud Version are you currently using: 29

Is your feature request related to a problem? Please describe.
I use nextcloud to store my photos. There is gazillion of them and because of that, I've stored them to S3 storage account. The problem comes when accessing the directories containing the images. My nextcloud instance starts generating the previews. The generation causes responsiveness issues because: a) I'm running a VM with low end CPU b) the latency between my VM and the S3 storage and C) lots of images in the directory (they are grouped by month).
Now, this sounds exactly like a probmlem which preview generator has been made to solve.
EXCEPT:
It creates a lot of unnecessary files that I could just fine live without. Those files eat all my available (local) file space. I just want to have the minimum previews pre-generated, that is 64x64 and 256x256.

I've configured the system with:
occ config:app:set --value="64 256" previewgenerator squareSizes
occ config:app:set --value="" previewgenerator squareUncroppedSizes
occ config:app:set --value="" previewgenerator widthSizes
occ config:app:set --value="" previewgenerator heightSizes

Yet there appears to be files such as 2048-1536-max.jpg, 480-640-max.jpg, (basically anything XXXX-YYYY-max.jpg)

Describe the solution you'd like
I would like to have an option to disable the pre-generation of the *-max.jpg (or .png etc) files, thus saving a lot of space (and resources). Having (small) thumbnails available when browsing ancient directories will make the browsing experience better and if needed (ie. clicked on), then the nextcloud instance can create the requested image to generated at higher resolution.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the previewgenerator configuration options and the code that generates *-max image files; the issue names the squareSizes, squareUncroppedSizes, widthSizes, and heightSizes settings as the relevant entry points. Done means an option can prevent pre-generation of *-max files while retaining the requested 64x64 and 256x256 previews.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.