- First commit to issue fork.
- Status changed to RTBC
12 months ago 12:58pm 9 May 2024 - πΊπ¦Ukraine sickness29
Hi @murilohp
image widget crop does not allow to add multiple crop types per image style and it does not make sense.
Steps to reproduce is not accurate as you need to hack module code to make 5th point workHi @phenaproxima
please check my comment and move issue status to fixed if you agree. Thanks - π«π·France DrDam
@sickness29 :
In fact, it's a limitation of the Crop Entity it self.I actually have a real use case for this type (particularly when you want to render several versions of the image via responsive).
- You can define 2 distinct image styles: "16-9-large" and "16-9-thumbnail" (both using the same "16-9" CROP-TYPE). The difference is in the dimensions displayed (one 1k px wide, the other x00 px wide).
- You can render the image in the 2 styles separately (using the image formatter or using responsives images).
- For ALL the other styles, you can choose an area of interest different to that of 16-9 CROP-TYPE (That's main adventage in frontof focal-point).
- But if your 2 images use the same type of CROP, you can no longer have 2 different aera of interest (one for each style).The "classic method" for handling this case consists of creating a CROP-TYPE for each variant of the "same CROP-TYPE" (on for the "16-9-large" and another for "16-9-thumbnail"), and finally have a CROP-TYPE for each image style that uses a CROP.
What is the point of distinguishing the CROP-TYPE from the image style if the global solution are to have a 1-1 relation ?
- π§π·Brazil peduardo
At the line 184 I just put an isset to validate if the key type is there
if (isset($effect['type']) && $crop = self::findCrop($uri, $effect['type'])) {
return $crop;
} - Status changed to Needs work
about 2 months ago 9:10am 10 March 2025 - π«π·France DrDam
It seems it was corrected in ImageWidgetCrop 3.x
On a fresh drupal install
- I have create 2 crop type
- On a unique image style, I add 2 effect "manual crop" (one for each crop)
- On the article mange display interface, I choose the image style which use the both crop
- On the article manage form display, I choose "ImageWidget Crop" widget. It only propose the "last crop type" for selection.see 3259571-IWC.png & 3259571-imageStyles.png
I propose to close this issue