Skip to content
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

Add preview mimetype support capabilities #22873

Closed
skjnldsv opened this issue Sep 16, 2020 · 7 comments
Closed

Add preview mimetype support capabilities #22873

skjnldsv opened this issue Sep 16, 2020 · 7 comments
Labels

Comments

@skjnldsv
Copy link
Member

skjnldsv commented Sep 16, 2020

ref nextcloud/viewer#577

On viewer, we have no way to know if the preview endpoint supports the file or not.
E.G for heic, they cannot be displayed directly in a browser, thus we need the preview endpoint. If imagick isn't installed, there is no support for heic, but we still register it as 'supported' in viewer

cc @MorrisJobke

@MorrisJobke
Copy link
Member

I just noticed that previews are registered via a regex. So the regex and a callback are passed to the preview manager. Then if a preview is requested it checks the mime type of that file against all regexes and calls the matching callback. So there is no easy way to just get back a list. Maybe we should pass down the regex?

Does that make sense to give the list of regex and then the client can reimplement this logic?

cc @rullzer

@rullzer
Copy link
Member

rullzer commented Sep 16, 2020

Just use the has preview property from webdav

@MorrisJobke
Copy link
Member

Just use the has preview property from webdav

@skjnldsv Might this be an option for the viewer?

@skjnldsv
Copy link
Member Author

No, because the file actions needs to be registered before. Otherwise we'd still open the viewer without a view to display it.

I need the list of mimes that can have a preview generated.
But if the fileActions API allows regex too, then it's fine for me. Otherwise, can we get it from gd or imagick?

@MorrisJobke
Copy link
Member

I need the list of mimes that can have a preview generated.

Then we don't have this, because we have a list of regexes that match a mime type.

Otherwise, can we get it from gd or imagick?

What do you mean? It also needs to have a preview provider on our side and not only in gd or imagick.

@skjnldsv
Copy link
Member Author

What do you mean? It also needs to have a preview provider on our side and not only in gd or imagick.

Ah right!
Then just getting the regex should be good I think? Does the fileActions support regex? I'm not in front of the workstation right now. If so, let's just output the capabilities as regex and string?

@skjnldsv
Copy link
Member Author

Done in nextcloud/viewer#1177

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants