diff --git a/src/Content/OEmbed.php b/src/Content/OEmbed.php index b0b018c1fb..37b8ec4290 100644 --- a/src/Content/OEmbed.php +++ b/src/Content/OEmbed.php @@ -33,6 +33,7 @@ use Friendica\Database\Database; use Friendica\Database\DBA; use Friendica\DI; use Friendica\Util\DateTimeFormat; +use Friendica\Util\Images; use Friendica\Util\Network; use Friendica\Util\ParseUrl; use Friendica\Util\Proxy as ProxyUtils; @@ -162,7 +163,13 @@ class OEmbed $oembed->type = $data['type']; if ($oembed->type == 'photo') { - $oembed->url = $data['url']; + if (!empty($data['images'])) { + $oembed->url = $data['images'][0]['src']; + $oembed->width = $data['images'][0]['width']; + $oembed->height = $data['images'][0]['height']; + } else { + $oembed->type = 'link'; + } } } @@ -190,7 +197,7 @@ class OEmbed $oembed->author_url = $data['author_url']; } - if (!empty($data['images'])) { + if (!empty($data['images']) && ($oembed->type != 'photo')) { $oembed->thumbnail_url = $data['images'][0]['src']; $oembed->thumbnail_width = $data['images'][0]['width']; $oembed->thumbnail_height = $data['images'][0]['height'];