Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I would like to force a default cropping to be applied on some image styles even if no cropping is defined. How would this be possible? Do you have a different idea in mind?
Comments
Comment #2
slashrsm CreditAttribution: slashrsm at MD Systems GmbH for Acquia commentedMaybe we could update image effect to allow us to configure the default crop? Would that work?
Comment #3
Lukas von BlarerYes, I had the same idea. Just a checkbox to enable this feature. Should it be enabled by default? I think yes.
Comment #4
slashrsm CreditAttribution: slashrsm at MD Systems GmbH for Acquia commentedYou would also need to define what is the default crop. I don't think it should be enabled by default.
Comment #5
Lukas von BlarerBut aren't we talking about an option on the existing image effect? You choose a crop type there, so shouldn't this be used as the default?
Comment #6
slashrsm CreditAttribution: slashrsm at MD Systems GmbH commentedBut crop type by itself doesn't have any crop information except aspect ratio (which is optional). If you'd just like to force that you can easily add a scale&crop effect after the manual crop effect. This second effect will make sure to convert the image to the desired size when no manual crop is defined and have no effect when it is.
Is this what you need or I completely misunderstood?
Comment #7
Lukas von BlarerAh ok. you are right. But the default cropping would only make sense if the aspect ratio is set, right?
The issue with the scale & crop effect is that you have to specify exact dimensions which I don't want to do in my current case. But basically that would work, yes.
Comment #8
woprrr CreditAttribution: woprrr as a volunteer commentedIMHO, it's not an feature to Crop API. For me we do only purpose an robust & clean storage feature in Crop API. That feature is already request in IWC issue #2810861: Automatically apply pre-selected crop types on node/media creation and it's main focus on it for me. With IWC we have all informations needed by you about ratio / size ...somthing you dream ;)
What's your opinion about it ?
Comment #9
woprrr CreditAttribution: woprrr as a volunteer commentedThis issue to, is in scope of "automated crop" discuss. It's my idea of Fallback on Crop api effect in #2830768: Automated crop integration
Comment #10
woprrr CreditAttribution: woprrr as a volunteer commentedAny opinion about this subject @slashrsm @Lukas von Blarer or others ?
Comment #11
Lukas von BlarerWe should decide which module shoud solve this. I am the wrong person to judge whether or not automated crop is the best solution. But we defenitely need a solution for this. Worth mentioning is that focal point already does this.
Comment #12
woprrr CreditAttribution: woprrr as a volunteer and commentedAutomated crop integration are ready for Crop API & Automated crop.
We can now add one more plugin specialized to Crop entity generation more information onto https://www.drupal.org/project/crop/issues/2830768#comment-12681573
Comment #13
Lukas von BlarerI guess this is a duplicate of #2865396: Provide option to apply default crop if user doesn't select any, right?
Comment #14
woprrr CreditAttribution: woprrr as a volunteer and commented@Lukas von Blarer, not totally duplicated because in that issue we purpose a workarround with an option not here to do that. Here we discuss about an official automatic cropping tool integration. Now Crop API take ability to subscribe an Event to purpose that feature (using in Automated_crop).