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

Allow file variant with different extension #488

Closed
7 tasks done
maxime-rainville opened this issue May 3, 2022 · 0 comments
Closed
7 tasks done

Allow file variant with different extension #488

maxime-rainville opened this issue May 3, 2022 · 0 comments

Comments

@maxime-rainville
Copy link
Contributor

maxime-rainville commented May 3, 2022

As a developer, I want to be able to create variant of files with different extensions.

Acceptance criteria

  • File URL of variants can still be resolved back to their parent file regardless of whether they have a different extension. (View FileIDParser)
  • You can still have file with the same name and a different extension and avoid collision.
  • Normal file operation like session grant, deletion, move, publication or archival apply to variant with different extensions as well.
  • There's an API for creating variant with alternative extensions.
  • Variants with different extensions can be created for regular files as well as image.
  • All Image manipulation functions work for variants with alternative extensions if they map to an image format.
  • All Image manipulation functions can be chained when applied to an image variant with a different extensions

Follow up task

We've decided te spin off the follow AC as it's own card:

  • Variants of Variants are handled in a sensible manner and avoid needless duplication.

This is meant to illustrate what "Variant of Variant" means. Note that those image conversion methods won't exist right away.

  • $JpegImage.Png().Jpeg() doesn't throw an error or create a duplicate of the original image.
  • $JpegImage.Png().WebP() doesn't throw an error, doesn't use an intermediary step and creates the same file has calling $JpegImage.WebP().
  • $JpegImage.FitMax(100,100).WebP() results in exactly the same file as $JpegImage.WebP().FitMax(100,100)

Notes

  • There's a proof of concept that implements all of these concepts.
    • There's a low level manipulate API for creating variant with alternative extensions (something similar to manipulateImage)
  • What happens when you upload image1.jpg, which has a webp variant, and then you upload a separate image1.webp? When you try to download https://example.com/assets/image1.webp which of the files do you get? Or does the existence of image1.jpg stop you from uploading image1.webp?
    • The URL for the variant webp is not just assets/image1.webp so there should be no conflict, but this should be validated.

Excluded

PRs

@maxime-rainville maxime-rainville added this to the Silverstripe CMS 5.2 milestone Oct 13, 2023
@emteknetnz emteknetnz assigned emteknetnz and unassigned emteknetnz Dec 13, 2023
@GuySartorelli GuySartorelli self-assigned this Jan 15, 2024
@GuySartorelli GuySartorelli removed their assignment Jan 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants