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

[WIP] feat: file conversion provider #49922

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

elzody
Copy link
Contributor

@elzody elzody commented Dec 18, 2024

Summary

This PR will introduce a file conversion API endpoint, which can be called to convert a file from one type to another. Apps can register their own conversion providers (which implement IConversionProvider), and the providers can define which MIME types they support for conversion via ConversionMimeTuples.

TODO

  • OpenAPI specs
  • Flesh out some more details around the IConversionProvider interface
    • What type should it really return? Stream, resource, File, file path?
  • What should happen when multiple apps register similar conversion providers?
  • How should we make the preferred list of conversion providers?

Checklist

@elzody elzody added enhancement 2. developing Work in progress feature: files feature: workflows php Pull requests that update Php code labels Dec 18, 2024
@elzody elzody added this to the Nextcloud 31 milestone Dec 18, 2024
@elzody elzody self-assigned this Dec 18, 2024
@elzody elzody force-pushed the feat/file-conversion-provider branch 2 times, most recently from 7e8ed84 to 3ab63cb Compare December 23, 2024 22:46

public function getSupportedMimeTypes(): array {
$jpegConversions = new ConversionMimeTuple('image/jpeg', [
'image/png',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something just came to my mind is that for integrating the user interface we may also want additional metadata for the target formats.

We can probably get the file extension from our mimetype mapping, but wondering if we need to have more details, like a display name. Similar to save dialogs that came to my mind:

Screenshot 2024-12-27 at 17 26 10

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sorbaugh Has the files team already discussed any UI parts with designers? I'd say we can start with this PR and could extend/adapt on demand later on as well.

@elzody elzody force-pushed the feat/file-conversion-provider branch from b1d9670 to 1bceac6 Compare December 27, 2024 19:58
elzody added 2 commits January 6, 2025 15:59
Signed-off-by: Elizabeth Danzberger <[email protected]>
Signed-off-by: Elizabeth Danzberger <[email protected]>
@elzody elzody force-pushed the feat/file-conversion-provider branch from bee2298 to 2cdd54b Compare January 6, 2025 20:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2. developing Work in progress enhancement feature: files feature: workflows php Pull requests that update Php code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants