Currently, if a user uploads a new image and never adjusts the cropping, EPSA crops the image according to the default settings on the image style settings for the EPSA crop action.

This disallows setting a more elegant cropping scheme in case the user wants to allow default cropping to occur.

In my particular use case, I'd like to offer the user the possibility to crop to a preset ratio, but if they don't crop, I'd like to use the Smart Crop module to do an automated crop that still looks nice.

With the current settings, EPSA does a blind crop. If I don't set any contraints in the EPSA crop, though, the user is allowed to crop to any ratio, which throws the theme design out of whack.

I propose a checkbox on the image style settings page for EPSA:
"Do not perform EPSA crop if the user does not manually crop the image"

As this is a time-sensitive and mission critical part of a project I'm working on, I'm happy to submit a patch if there's a chance it will be accepted.

Comments

aacraig’s picture

I've created a patch that implements this feature.

I've added a checkbox in the advanced settings which allows you to configure a style to fallback to other styles if the user never manually sets a crop.

In the crop function, I've added a check for this setting, and no crop occurs if it's been set.

This allows you to create a series of image styles (using Smart Crop, for instance) that allow for better default cropping when a user never sets the manual crop.

supermoos’s picture

The patch works for me :-) Just remember to put the Epsa crop first in the image styles :-)

cwithout’s picture

Status: Active » Needs review

Works great.

There's one thing I either didn't understand correctly about the patch or is worded wrong in the field description.

If a user does not manually set the crop, ignore these settings. This is useful if you want to use other effects to set a default crop, which may then be overridden manually using EPSA Crop. If this is unchecked, make sure that the EPSA Crop effect is the first in the list of effects.

Should that be "checked" rather than "unchecked"? Because it's when "Ignore if not manually set" is checked that you'd have other cropping effects like Smart Crop, etc. for fallback. If it's unchecked, you shouldn't have other cropping effects.

(Marked as needs review because issue has pending patch. If the above is correct, the patch is technically "needs work" to change wording, but I didn't want to mark it that way without clarification from aacraig.)

aacraig’s picture

You are correct, the word should be "checked".

However, thinking about it, it's probably a good idea if EPSA is always at the top.

cwithout’s picture

Maybe not always, but generally, yeah EPSA should be on top. You'd definitely always want it to be above the fallbacks. Anybody who would use it not on top is kind of breaking the rule and should know what they're doing.

But I think it's good to have that reminder in there that when you're using the fallback, you need EPSA crop above the fallbacks to work right. Otherwise, new users might not realize that.

It might be better to say something like: "When this is checked, make sure the EPSA Crop effect is above any fallback cropping effects."

aacraig’s picture

Yes, I like that wording.

cwithout’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new1.12 KB

Patch with new wording.

yvmarques’s picture

Status: Reviewed & tested by the community » Closed (fixed)

Thanks, I've committed the patch.

milesw’s picture

Excellent feature. Just want to say thanks for the work on making it happen. :)