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.
The function imageapi_image_crop from imageapi.module file has an error when calculaing aspect of the image:
$aspect = $image->info['height'] / $image->info['width'];
if (empty($height)) $height = $width / $aspect;
if (empty($width)) $width = $height * $aspect;
So for example when width is empty, calculated width = given height * image height / image width. This leads to strange aspect ratio for resulting image. I would expect that calculated width = image width. To correct this, modify calculated aspect:
$aspect = $image->info['width'] / $image->info['height'];
Sorry I don't how to make a patch.
Comments
Comment #1
drewish CreditAttribution: drewish commentedcould you try this on the latest release and let me know if it's still a problem?
Comment #2
ocanzillon CreditAttribution: ocanzillon commentedSorry I don't remember what was the use case... You can close this issue.