owncloud / core

:cloud: ownCloud web server core (Files, DAV, etc.)
https://owncloud.com
GNU Affero General Public License v3.0
8.37k stars 2.06k forks source link

Preview API: expose supported file/MIME types via Capabilities endpoint #31267

Open felix-schwarz opened 6 years ago

felix-schwarz commented 6 years ago

Clients targeting the Preview API at remote.php/dav/files/[user]/[file]?x=[width]&y=[height]&c=[eTag]&preview=1 have no way of telling in advance for which file types a preview can likely be expected to be available.

Ideally, a list of MIME types, for which the Preview API is likely capable of providing a preview, would be available as part of the capabilities endpoint.

Using that list, clients could then see if the MIME type of an item is in that list and only request thumbnails for those items for which this is the case.

ownclouders commented 6 years ago

GitMate.io thinks the contributor most likely able to help you is @PVince81.

Possibly related issues are https://github.com/owncloud/core/issues/14106 (previews broken for non-supported file types), https://github.com/owncloud/core/issues/7574 (Add to mime type list), https://github.com/owncloud/core/issues/15124 (MPO support), https://github.com/owncloud/core/issues/29076 (Add eml to list of known mime types), and https://github.com/owncloud/core/issues/29158 (Dear Support, ).

michaelstingl commented 6 years ago

Related docs: https://doc.owncloud.org/server/latest/admin_manual/configuration/server/config_sample_php_parameters.html#previews

'enabledPreviewProviders' => array(
        'OC\Preview\PNG',
        'OC\Preview\JPEG',
        'OC\Preview\GIF',
        'OC\Preview\BMP',
        'OC\Preview\XBitmap',
        'OC\Preview\MP3',
        'OC\Preview\TXT',
        'OC\Preview\MarkDown'
),
michaelstingl commented 6 years ago

Could the capability also include available formats of the preview itself?

Example 1

Source:

Available previews:

Example 2

Source:

Available previews:

Related:

felix-schwarz commented 6 years ago

Yes, this would be awesome. That way, clients could - in addition to knowing which files to request previews for - also pick the preview format they can process best.

ownclouders commented 6 years ago

Hey, this issue has been closed because the label status/STALE is set and there were no updates for 7 days. Feel free to reopen this issue if you deem it appropriate.

(This is an automated comment from GitMate.io.)

ownclouders commented 6 years ago

Hey, this issue has been closed because the label status/STALE is set and there were no updates for 7 days. Feel free to reopen this issue if you deem it appropriate.

(This is an automated comment from GitMate.io.)

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 10 days if no further activity occurs. Thank you for your contributions.