Problem/Motivation
The Frontify media-processing CDN downscales any source whose longest side exceeds 4096px before applying a crop segment. Crop rectangles expressed in original source pixels therefore land on the wrong region for large assets: on our pages the first image of a set (within the limit) rendered correctly while the second/third (larger sources) cropped a visibly wrong area.
Proposed resolution
When building the crop parameters, scale the whole crop (offset and size) by 4096 / longest_side for sources exceeding the limit, so the rectangle is expressed in the CDN's working space and stays within it.
Tested against 3.0.1. We carry this as a composer patch in production (Drupal 11, PHP 8.4). Happy to open an MR if the approach is agreed.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | frontify-cdn-crop-cap-3611094-4.patch | 4.13 KB | julien |
| #2 | frontify-cdn-crop-cap-3611094-3.patch | 4.07 KB | julien |
Comments
Comment #2
julien commentedAttaching the patch we carry in production (against 3.0.1; note it applies on top of the focal-point patch from #3611096, which creates FrontifyImageStyleService). Happy to fold both into MRs.
Comment #3
julien commentedThe patch in comment #2 had its final hunk over-trimmed and does not apply - corrected patch attached (applies on top of the focal-point patch from #3611096). Please disregard the earlier file.