Closed GuySartorelli closed 5 months ago
Moved the refactoring into https://github.com/silverstripe/silverstripe-assets/pull/587
Marking this as draft because it'll have conflicts once that is merged.
I'm not even sure if that's viable, to be honest. Each variant is a file. Here you have one variant for the file conversion, and another variant for scaling the image - and because those are discrete steps, they create discrete files.
I'm pretty sure the same thing would happen if you scaled and then rotated an image - you'd have one variant (and therefore one file) for the scaling operation and one for the rotation operation.
I don't think changing that is really feasible - or at least with my current limited understanding of the assets system I can't think of a way to tackle it.
Description
Provides a low-level API for generating a file variant which has a different extension than the original file. e.g. could be used for:
Manual testing steps
Use this code for
PageController
. Replace/var/www/html/.eddev/samples/snickers.jpg
with the absolute path to some arbitrary image file your site can access (or replace that logic with something to actually generate a file from the video - I'm taking some shortcuts in that regard) Replace/var/www/html/.eddev/samples/client-pdf2.pdf
with the absolute path to some arbitrary pdf file your site can access (or replace that logic with something to actually generate a pdf from the document - I'm taking some shortcuts in that regard)You can also try the documentation example of converting one image to another image (e.g. a
.jpg
to.webp
) and see that it also works correctly, even with chained image manipulations.Issues
Pull request checklist