]> git.mxchange.org Git - friendica-addons.git/commitdiff
[twitter] Add expected dimensions in parse_url hook function
authorHypolite Petovan <hypolite@mrpetovan.com>
Thu, 5 Nov 2020 06:16:40 +0000 (01:16 -0500)
committerHypolite Petovan <hypolite@mrpetovan.com>
Thu, 5 Nov 2020 06:16:40 +0000 (01:16 -0500)
- Addresses https://github.com/friendica/friendica/issues/9447#issuecomment-722024085

twitter/twitter.php

index 7d77f83cc02cd0c66aa905d694b1e24f271a2e02..e2208090c12c6a6fdc3b08815a59943d7569bcff 100644 (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'] = [