From: Hypolite Petovan Date: Thu, 5 Nov 2020 06:16:40 +0000 (-0500) Subject: [twitter] Add expected dimensions in parse_url hook function X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=d0d2a3269a7bdc0c2cb1763769de1866ead91148;p=friendica-addons.git [twitter] Add expected dimensions in parse_url hook function - Addresses https://github.com/friendica/friendica/issues/9447#issuecomment-722024085 --- diff --git a/twitter/twitter.php b/twitter/twitter.php index 7d77f83c..e2208090 100644 --- a/twitter/twitter.php +++ b/twitter/twitter.php @@ -935,7 +935,11 @@ function twitter_parse_link(App $a, array &$b) if ($b['format'] == 'json') { if (!empty($status->extended_entities->media[0]->media_url_https)) { - $images = [['src' => $status->extended_entities->media[0]->media_url_https]]; + $images = [[ + 'src' => $status->extended_entities->media[0]->media_url_https, + 'width' => $status->extended_entities->media[0]->sizes->thumb->w, + 'height' => $status->extended_entities->media[0]->sizes->thumb->h, + ]]; } $b['text'] = [