-
Notifications
You must be signed in to change notification settings - Fork 66
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
API/Service for registering "converters" that will create file variant under a different extensions #489
Comments
Do we want to consider a file variant under the same file extension/same type of file? I guess the question is what is a file variant in this piece of work. Would e.g. adding a watermark and saving as the same file type constitute a variant? Or should it be a different file name and that will not be seen as a variant? |
#488 mentions that calling I think the converter API should not explicitly say "this is already a jpeg so I'm not touching it" - i.e. developers could use the converter API to define their own converter that adds a watermark to a jpg and outputs a jpg - but they should define their own method in an extension on the I think it would make sense for the result of that to be a variant, rather than its own file - but maybe there could be a way for developers to choose whether the output of conversion is a variant or a new |
There's currently nothing stopping you from creating your own variant methods to do something like It doesn't look like our image manipulation are smart enough right now to avoid de-duplicating themselves. e.g.: It could very well be that if you have a scenario like |
I'm thinking the interface for a converter can probably look something like this: interface FileConverter
{
public function canConvert(string|DBFile $from, $to): bool;
public function convert(DBFile $file, $to): DBFile;
} You would need some sort of conversion service to register all your converters. That service would have a |
These notes were intially in the main issue, but they don't seem all that relevant right now. Notes
|
As a CMS Developer, I want clear and simple direction when implementing logic that converts files between formats.
Acceptance criteria
Excludes
PRs
The text was updated successfully, but these errors were encountered: