Created on 22 April 2024, 7 months ago
Updated 4 September 2024, 3 months ago

Problem/Motivation

The current state of the solution is based on some hacks on Core and CROP, with some evolution on theses elements, the whole integration will be "cleaner" for D11

<!--break-->

Proposed resolution

1. Make ImageStyleDownloadController easily extendable

- Find a way to "split" some control elements out of the "deliver" method into protected methods in order to more easily extends the method.
- exemple : L114-125 => check for scheme throwing NotFoundHttpException, can be a protected method out side of the deliver method

==>> Update https://www.drupal.org/project/drupal/issues/2685905#comment-15756509 Refactor ImageStyleDownloadController so derivatives can be generated by contrib modules Needs work

2. Provide to core a way to manage contextuals derivatives (no effect without crops)

On ImageStyleInterface and ImageStyle class
- Add an optional string parmeter "context" on the "createDerivative" method, this parameter will be passed to effects.

On ImageEffectInterface and subclasses
- Add an optional string parmeter "context" on the "applyEffect" method (get from ImageStyle::createDerivative method)
=> can be difficult because inject regretion in all EffectPlugins

==>> patch : 2-add_context_to_image_style.patch

3. Better intergration with CROP

On Crop API & plugins
- Add an optional string parmeter "context" on the Crop::findCrop method, in order to load contextual CROP (currently : context = crop_id)
- In applyEffect method on Effect Plugin Classes, send the "context" to the Crop::findCrop method

==>> patch : 3-focal_point.patch
==>> patch : 3-crop.patch (need to be applied after "provide_contextual_capability_to_crops"

4. Find a standard way to manage Contexts (optional)

On CropEntity
- Find a better way to "obfuscate" the context (not using the crop_id anymore) that will use as less resources as possible on crop search/load, and not a long hash (to have the "cleanest" filename).

🌱 Plan
Status

Active

Version

2.2

Component

Code

Created by

🇫🇷France DrDam

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024