feat: Allow image previews of Files image links - #2946
Conversation
|
@enjeck works like a charm :) |
|
|
In theory you could do it like the files app and if it is an internal file link of any kind, check for a preview? Than you could also show previews for documents for example 🚀 Could of course also just be a follow-up or a thing "for later". In any case, love the feature 🎉 |
|
Signed-off-by: Enjeck C. <patrathewhiz@gmail.com>
7f9df5d to
71c6068
Compare
Signed-off-by: Enjeck C. <patrathewhiz@gmail.com>
|
Woohoo 🎉 |
|
@enjeck i pulled all your latest changes and when i upload a pdf this is how the is shown for me still, is there something im missing? |
|
@samin-z did you enable the preview provider in the config.php? (If you also only see the mimetype icon in the files view, than the provider is turner off) |
@AndyScherzinger yeah i noticed that and that's what im currently doing |
|
@enjeck all good |
blizzz
left a comment
There was a problem hiding this comment.
We had in a conversation before. If the URL is not a local one, then the browser will do an outreach to an external site. This should not be a security issue… but it can be a privacy issue, as you could leak IP or browser details to a foreign website. Whether this is an issue, it depends… if the field is set from outside (e.g. via public link share) than it would not be trustworthy. If from a user on the instance, it depends on the relationship there. In this hindsight, I am not sure whether we should or have to nail this down a little. (The scenario could also be a user on the instance sharing bad links to outside people).
If we align on having only internal images anyway we can validate against the domain or or just strip it and use a relative path.
- otherwise,
ColumnService::validateCustomSettings()could also guardshowPreview/imagePreviewSize. - also changing the setting goes not update exisitng rows.
- ResponseDefinitions needs to have
customSettingsupdated - All previews are fetched at once, this could lead to 100 requests at towards /core/preview. Claude suggests Adding
loading="lazy"anddecoding="async"to the<img>is a one-line change that makes this safe on large tables. - It also suggested to limit the preview sizes to 32/64/96/128/192 which is generated by NC.



You can create an Link column type and enable previews. Images in the Files app would be shown:
Shown like so, and the size is customizable:
Fixes #580