Support browser image transformations#7845
Open
evan6seven wants to merge 4 commits into
Open
Conversation
f1a29e3 to
366ec3e
Compare
Member
|
@evan6seven this would be a great feature in Decap CMS, but before we merge it, we need to agree on what it would look like. Did you see issue #7107? There was a lot of debate around how to do it. I think it addresses a similar question, but in much more detail. You added the Photon dependency, which could be a good fit, but I have some concerns. Most notably, it's maintained by a single person. The history is not in favor of the longevity of such libraries, so we have to be really cautious before we use it. |
Author
|
Thanks, I had not seen that issue discussion. I will read it and incorporate decisions from there. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
From Issue #2808
Summary
Adds browser-side image transformations for media uploads, allowing projects to define generated image variants in CMS config and field config. Uploaded images can now be converted or resized before being persisted by the normal media upload flow.
What changed
image_transformationsconfig shape for defining generated variants.Fileuploads work reliably._transformations/...files in draft media selection.Why
Some sites need CMS uploads to produce optimized image assets, for example converting uploaded images to WebP or creating resized variants before the file is stored. This keeps that behavior inside the existing Decap media upload path instead of requiring a separate backend processing step.
The draft media changes are needed for image widgets when
keep_originalis disabled. In that case the only uploaded file may live under_transformations/<variant>/...; without including those generated paths in draft media selection, the upload succeeds but the widget cannot select or insert the generated asset.Notes
jpegvariant format is normalized tojpgfor filenames and MIME handling.Testing
Manually end to end test with sample jpg files in an existing production Decap base project.