-
-
Notifications
You must be signed in to change notification settings - Fork 554
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
[5.x] Driver based image manipulation with render tag #10204
Draft
jasonvarga
wants to merge
36
commits into
5.x
Choose a base branch
from
image-manipulation
base: 5.x
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains 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
…asically copy pasted)
Dedicated classes to represent sources now replace - awkward string|Asset union types - SourceType enum. the class itself is the identifier of the type. All source classes can return an asset. - For external urls, they will be null - For assets obviously the asset - For asset ids it will resolve the asset by id - For paths it will attempt to resolve by url from the root. This happens for the existing implementation. Render tag: - The driver method accepts the raw source and converts it to the class. - Uses the new source ahead of time to resolve the focal point when using fit="crop_focal"
Would this be something in the future where Statamic itself would support a certain number of popular image providers by default? Or would they all be addon based? Just curious because we use Cloudflare images as our image provider. |
Cloudflare images is probably a good one to also support natively. |
# Conflicts: # src/Facades/Glide.php # src/Http/Controllers/CP/Assets/ThumbnailController.php # src/Imaging/ImageGenerator.php
Adding focal point params is upcoming and this will make it consistent and clearer that we don't want to override the entire the entire array of params.
This was referenced Sep 30, 2024
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.
Warning
This is very much a work in progress.
Currently, all image manipulation is fairly tightly integrated with Glide.
This PR introduces the concept of driver-based image manipulation. Glide will continue to ship as the default, but it will become easier to swap it out for other services such as Imgix, Cloudinary, Cloudflare Images, etc.
This will also introduce a new
render
tag which will be essentially identical to theglide
tag but allow you to use any driver. For example, if you were to use the imgix driver, you'd be able to use their face detection and background removal features:This is aimed to be introduced in the 5.x line at some point, so everything should be backwards compatible. You will be able to opt into it by either using the new
render
tag, or by customizing your image manipulation config file.?p=whatever
as a param, it would unpack them and do?w=100&h=100&etc=
width
=>w
)fit="crop_focal"
param only works for glide. Needs to be smarter. e.g. glide wants?fit=crop-1-1-1
but imgix wants something like?fit=crop&crop=focalpoint&fp-x=1&fp-y=1&fp-z=1