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.
Focal point is generally a helpful solution to getting better image crops, but we have found that our clients would prefer to have more control over image cropping and a more direct sense how much an image is being cropped from the node edit page. Can this be investigated as part of the lightning authoring experience?
Comments
Comment #2
phenaproximaI completely agree about the need for a cropping solution. Big +1 there. The approach I'd like to take, however, is that users should upload full-size images into their media library, then crop them only when used. In other words, I can upload a single image, then crop it differently each time I use it. This is going to take some serious rejiggering.
Comment #3
phenaproximaI suggest this as an 8.x-1.10 target.
Comment #4
energee CreditAttribution: energee as a volunteer commented@phenaproxima, that approach sounds great to me.
Comment #5
saltednutAnother option re: "Crop when use" could be to use to define crop presets. This would allow for the governance site admins need while also giving editors some freedom. Happy to discuss this further - much easier to show if we can get some IA together, but the basic premise would be that the "crop" area could be limited to height and width settings based on a pre-existing standards that are used by marketers, commonly used ratios etc. E.g. Instagram (square), Facebook cover photo (850 x 315 rectangle), 4:3, 3:4, 16:9 etc.
Comment #6
balsama@phenaproxima and I talked about this yesterday, but I hadn't need @brantwynn's comment til now. Basically, we decided that whatever we implement needs to be built on top of the crop api... and the the more simple image widget crop is probably preferred over focal point if we ship with something.
I don't think I fully grok what Brant is proposing. We'll touch base when we start working on this (probably this week or early next).
Comment #7
phenaproximaCreated an issue for bringing Crop API into Lightning: #2766381: Add Crop API to Lightning
Comment #8
miro_dietikerSee dicussions in Crop API and implementations on top of it: Core does not allow per-instance crops.
A crop is bound to an image style and every image only has one instance per image style.
Core does not allow us to have multiple dynamic instances/placements of an image.
Thus cropping a media once affects all placements.
See #2617818: Support multiple crop variants per URI and crop type
Finally, if you search for the UI module that allows this explicit cropping, we have created:
https://www.drupal.org/project/issues/image_widget_crop
We are happy to improve it for even better UX.
Comment #9
phenaproximaRe-prioritizing for 8.x-2.x.
Comment #10
miro_dietikerWe have previously used image_widget crop and switched with a newer distribution to focalpoint for more simplicity for the user.
Best seems to us to start with focal point and optionally provide more control.
One option would also be to offer an optional zoom factor on focal point.
Finally, we still hope that we can integrate focalpoint with some autocropping tool that identifies faces, other objects of interest or just entropy. Other software refers to results where >95% of crops do no more need manual adjustments. That's a promising number!
Comment #11
phenaproximaPull request created! https://github.com/acquia/lightning/pull/439
Comment #12
balsamaLooks great. A few CI tweaks I'm also going to include:
Comment #14
balsama