[twitter] Add expected dimensions in parse_url hook function #1040

Merged
MrPetovan merged 1 commit from bug/9447-twitter-parse-url-dimensions into develop 2020-11-05 07:30:33 +01:00

View file

@ -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'] = [