Not saving height and width?

Created on 3 June 2025, 10 days ago

As far as I can tell, assigning a focal point to an image doesn't save the height and width attributes of that image.

This came up while I was mangling the Single Content Sync β†’ plugin, and observing that these attributes weren't appearing the export data, and thus when imported the focal points would get lost because the calculations for X and Y always used 0 as height and width values.

And when I examine the crop_field_data table, I observe that in fact those values are not populated.

It looks to me like the Crop β†’ plugin does save the values, and when I take a look at this plugin I see this in FocalPointManager.php:

  public function saveCropEntity(float $x, float $y, int $width, int $height, CropInterface $crop): CropInterface {
    $absolute = $this->relativeToAbsolute($x, $y, $width, $height);

    $anchor = $crop->anchor();
    if ($anchor['x'] != $absolute['x'] || $anchor['y'] != $absolute['y']) {
      $crop->setPosition($absolute['x'], $absolute['y']);
      $crop->save();
    }

    return $crop;
  }

No height and width save there?

For now I've solved my immediate issue (I hope) by hacking single_content_sync, but this might need some examination here, unless I'm quite mistaken.

πŸ› Bug report
Status

Active

Version

2.1

Component

Media Integration

Created by

πŸ‡ΊπŸ‡ΈUnited States datawench

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

Comments & Activities

Production build 0.71.5 2024