Is focal point scale and crop switched?

Created on 28 March 2025, 27 days ago

Im trying to get the Scale and Crop image style to work with Acquia DAM images, but I noticed that int the "EmbedCodeUrlBuilder.php" file we sets the "focal_point_scale_and_crop" case without an anchor parameter - which means the focal point is ignored:

        case 'focal_point_scale_and_crop':
          $values['crop'] = 'yes';
          $values['w'] = $effect['data']['width'];
          $values['h'] = $effect['data']['height'];
          break;

Instead, the anchor point is added within the "focal_point_crop" case:

        case 'focal_point_crop':
          if (isset($effect['data']['crop_type'])) {
               ...  
            $position = $crop->position();
            $values['crop'] = 'yes';
            $values['w'] = $crop_width;
            $values['h'] = $crop_height;
            // anchor tag set here
            $values['a'] =
              self::calculateAnchorPointForWiden($position['x'], $crop_width, $calculated_with)
              . ','
              . self::calculateAnchorPointForWiden($position['y'], $crop_height, $calculated_height);
          }
          break;

Looks like its been like this for years, so I'm not sure if its an issue or if I'm missing something. Does anyone know why "focal_point_scale_and_crop" omits the anchor parameter?

πŸ’¬ Support request
Status

Active

Version

1.1

Component

Code

Created by

πŸ‡ΏπŸ‡¦South Africa itsruanduplessis

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024