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.

Comments

julien created an issue. See original summary.

julien’s picture

Status: Active » Needs review
StatusFileSize
new4.07 KB

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

julien’s picture

StatusFileSize
new4.13 KB

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