mirror of
https://github.com/friendica/friendica
synced 2025-04-26 23:50:11 +00:00
Add height allocation support for single images smaller than the available width
This commit is contained in:
parent
c4657c4661
commit
06818a96c3
4 changed files with 22 additions and 10 deletions
|
@ -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']) . '%';
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue