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.
By slashrsm on
Change record status:
Published (View all published change records)
Project:
Introduced in branch:
8.x
Issue links:
Description:
Function image_dimensions_scale() has been moved to a component and now lives under \Drupal\Component\Image\Image::scaleDimensions(). image_dimensions_scale() is still available, but it is marked as deprecated and it's usage is discouraged.
Usage before this change
$modified = image_dimensions_scale($dimensions, $target_width, $target_height);
if ($modified) {
// use new dimensions.
}
After this change
use \Drupal\Component\Image\Image
;
$modified = Image::scaleDimensions($dimensions, $target_width, $target_height);
if ($modified) {
// use new dimensions.
}
Impacts:
Module developers