Add height allocation support for single images smaller than the available width

This commit is contained in:
Hypolite Petovan 2023-09-24 06:47:18 -04:00
parent c4657c4661
commit 06818a96c3
4 changed files with 22 additions and 10 deletions

View file

@ -1173,12 +1173,6 @@ class Media
*/
public static function getAllocatedHeightByMedia(array $media): string
{
if (!empty($media['preview-height'])) {
$allocated_height = (100 * $media['preview-height'] / $media['preview-width']) . '%';
} else {
$allocated_height = (100 * $media['height'] / $media['width']) . '%';
}
return $allocated_height;
return (100 * $media['height'] / $media['width']) . '%';
}
}