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

Lukas von Blarer created an issue. See original summary.

slashrsm’s picture

Issue tags: +D8Media

Maybe we could update image effect to allow us to configure the default crop? Would that work?

Lukas von Blarer’s picture

Yes, I had the same idea. Just a checkbox to enable this feature. Should it be enabled by default? I think yes.

slashrsm’s picture

You would also need to define what is the default crop. I don't think it should be enabled by default.

Lukas von Blarer’s picture

Issue summary: View changes

But 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?

slashrsm’s picture

But 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?

Lukas von Blarer’s picture

Ah 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.

woprrr’s picture

IMHO, 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 ?

woprrr’s picture

This issue to, is in scope of "automated crop" discuss. It's my idea of Fallback on Crop api effect in #2830768: Automated crop integration

woprrr’s picture

Any opinion about this subject @slashrsm @Lukas von Blarer or others ?

Lukas von Blarer’s picture

We 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.

woprrr’s picture

Automated 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

Lukas von Blarer’s picture

woprrr’s picture

Status: Active » Fixed

@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).

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.