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.
I am trying to resize one edge of an image prior to cropping down to the final size. Here is what I have:
if ($height < $width) { // landscape
imageapi_image_scale($image,$width = 600);
}
if ($width < $height) { // portrait
imageapi_image_scale($image,$width = 200);
}
if ($height == $width) { // square
imageapi_image_scale($image,$width = 600);
}
return $image;
When height < $width, I am indeed seeing a resize of the width to 600. When $width < $height, I am not getting width to be resized to 200. Is there a syntax error somewhere?