-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make list of permanently saved preview thumbnails configurable #8196
Comments
makes sense,
We could furthermore remove the explicit exposure of width and height and replace it with smth like type=filelist which then maps to 32x32 e.g. Apps could either register their own types or create their own preview.png |
The explicit width and height are used on high dpi screens to get the correct resolution previews |
Closing due to inactivity. If a better implementation is realized, please open a PR. |
This is how MediaFire is doing it: |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Depending on the installed apps preview thumbnails in various sizes are needed. Files needs 36x36, Pictures uses 200x200, Mobile and Tablets also need various sizes.
The current Preview thumbnail generation is quite flexible as you can specify the dimensons you want for the thumbnail. It will be scaled on the fly, which might take too long when the image is 10MB and no thumbnail is available.
The problem with caching ALL generated thumbnails is that it allows a malicious user to fill the disk by generating thumbs in 1000x1000, 1000x999, 1000x998 ... or even 100000x100000 when scaling up.
The current Implementation tries to prevent that by using the next bigger thumbnail to generate a thumbnail. If no Thumbnail exists it will use the original and save the thumbnail in the requested size. That has several drawbacks:
I propose adding an optional configuration key to the config file like this:
In addition the API should allow apps to add permanent thumbnail sizes. The Pictures app eg, could then use
OCP\Config::addPermanentPreviewSize(200,200);
Files could useOCP\Config::addPermanentPreviewSize(36,36);
These calls would only add entries to the config array.This would allow the next ™️ Photo editing app to add new custom thumbnail sizes.
The code generating the thumbnails could then check if the requested size matches a configured permanent size and cache the thumbnail if it does not exist, yet.
@georgehrke @DeepDiver1975 @icewind1991 what dou you think?
The text was updated successfully, but these errors were encountered: