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 thumbnail support for Nextcloud/OwnCloud #165

Open
skjiisa opened this issue Aug 29, 2020 · 0 comments
Open

Add thumbnail support for Nextcloud/OwnCloud #165

skjiisa opened this issue Aug 29, 2020 · 0 comments

Comments

@skjiisa
Copy link

skjiisa commented Aug 29, 2020

Currently the only WebDAV server that this library supports fetching thumbnails from is yandex, but Nextcloud and OwnCloud support thumbnails too, using a different method.

To fetch a thumbnail from Nextcloud, download the file index.php/core/preview.png with the file parameter set to the file path, the x and y parameters set for dimensions, and optionally a=1 and mode=cover. a=1 will crop the image to fill the dimensions specified whereas omitting it will keep the aspect ratio, making the result equal-to or smaller-than the specified dimensions. I haven't been able to figure out what mode=cover does, but that's what the official Nextcloud app uses.

Example: https://nc.example.com/index.php/core/preview.png?file=Media/image.png&x=128&y=128&a=1&mode=cover

Currently thumbnailOfFile and thumbnailOfFileSupported check if the WebDAV host contains dav.yandex., though Nextcloud and OwnCloud servers can have any domain name, so I'm not sure how it could be checked if the server is Nextcloud or OwnCloud in order to use this thumbnail-fetching method, or to check if thumbnails are supported.

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

Successfully merging a pull request may close this issue.

1 participant